fix(jump): do not force charwise Operator-pending jump#2332
fix(jump): do not force charwise Operator-pending jump#2332abeldekat wants to merge 1 commit intonvim-mini:mainfrom
Conversation
|
Thanks for the PR! As this stands, I don't think it is a
Also:
So describing this as a I noticed one problem with this change: highlighting disappears only after second unrelated cursor move if Operator-pending jump did not actually jump. I.e. with This might be not a problem if there is no highlighting after an Operator-pending jump, but currently there is. I am still on the fence about whether removing all highlighting is a good thing or a technical necessity. |
3b1474c to
a2d7c0c
Compare
Details: - Highlight matches even when the Operator-pending jump did not succeed. This can happen if the jump is not possible, but there are matches in the other direction. - The internal `undo` workaround is not needed anymore. Resolve nvim-mini#2323
a2d7c0c to
1ea42cf
Compare
Indeed, that's a side effect of removing the 'undo'. On the first 'l', H.cache.n_cursor_moved is still 0.... I would like to fix that, not sure how at the moment. |
Would the code below be acceptable? -- If target not found in Operator-pending expression mapping, charwise-visual
-- is reverted, preventing a character from being consumed.
-- Do it here to also act on dot-repeat.
if is_expr and not has_jumped then
H.on_cursormoved()
vim.cmd('normal! v')
end |
Judging simply by the code - not quite. It basically reads as "If inside expression jump and not jumped act as on cursor moved". |
Details:
Alwayshighlight matches even when the Operator-pending jump did not succeed. This can happen if the jump is not possible, but there are matches in the other direction.The internal
undoworkaround is not needed anymore.This change is breaking for users that testMiniJump.state.modeto be equal to 'nov'. In that situation, the mode is now 'no'.Resolve #2323