fix(jump): do not force charwise Operator-pending jump#2332
fix(jump): do not force charwise Operator-pending jump#2332echasnovski merged 1 commit intonvim-mini:backlogfrom
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
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". |
In normal mode, a similar scenario also happens on latest main: With mark as a line and cursor on a: Same cause: State is in jumping mode, but there was no jump, and thus no I have an idea to fix this in the same manner for all modes. It's probably best to create a new PR after this one is merged. |
|
I changed the text of corresponding issue #2323 to be less verbose. Please let me know if anything else needs to be done before merging. |
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
1ea42cf to
c2421da
Compare
|
This now should be part of the latest The code looked good, I only tweaked a new "cursor on empty line" testing. |
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