-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
Using "native" keyboard navigation of CTRL+<arrow-key left/right> to jump to beginning end of a word is now broken.
This happens after vim enters a "broken state". If you then jump forward a word using ctrl+right or backward using ctrl+left then try to navigate using left or right, the cursor jumps back to its position before using ctrl+arrow-key. The console reports [warning] Ignoring slipped selection: [n, n; n, n]. Same for using Home or End. Other navigation could also be impacted but I mostly use the ones I mentioned.
Upon further testing VIM appears to enter the "broken state" consistently when moving the cursor between lines of difference length, but only at the end of the line.
Toggling VIM off then on fixes the behavior until navigating over the last character of a foldable region (even if it is unfolded).
Disabling Foldfix resolves the issue as does reverting to v1.25.2 with Foldfix still enabled.
To Reproduce
Steps to reproduce the behavior:
- Enable
Foldfix("vim.foldfix": true) - Move cursor up/down between lines of same length = ok
- Move cursor up/down between lines of different length but not at the end of the line = ok
- Move cursor up/down between lines of different length at the end of the line = enters "broken state"
- Notice console log of
[warning] invalid cursor position. [n:n | n:n]followed immediately by[warning] Ignoring slipped selection: [n, n; n, n] - Try navigating using
ctrl+arroworhome/end - Notice console log of
[warning] Ignoring slipped selection: [n, n; n, n]every time you do - Try navigating using
arrow-keyeither left or right - Notice the cursor does not behave as expected
- Restart vim using
toggleVimthentoggleVimagain - Perform the same movement using
ctrlorhome/endfollowed byleft/right - Notice the behavior is back to normal and no warning logs in console
Expected behavior
It's as if the cursor position is not updated properly when in the "broken state" and using ctrl or the other ones.
So if my cursor position is at column 3, then I jump to the end of the next word which puts me at column 10, when I hit right arrow I expect the cursor to move to col 11 but it instead moves to col 4.
Screencasts
Example 1 - Normal behavior then entering "broken state"
ignoring-slipped.mov
Example 2 - Invalid cursor position + Ignoring slipped selection when navigating around bracket (?)
invalid-position.mov
Example 3 - Issue is fixed after restarting VIM (I have alt+v mapped to do this)
fixed-after-toggle.mov
Environment (please complete the following information):
- Extension (VsCodeVim) version:
1.26.0 - VSCode version:
1.82.0 - OS:
Windows,Browser (Vscode.dev)
Additional context
I have not tested this behavior with VIM handling of arrow keys disabled.