Vim: Vim cursor does not move with "Go to Next Problem"
Describe the bug When using the keyboard shortcut for “Go to Next Problem”, the focus and cursor move to the next problem in the file. However, using any vim action starts from where the cursor was last, before the keyboard action.
To Reproduce Steps to reproduce the behavior:
- Create a file with linting enabled (I used Python with Pylance language server).
- Make a syntax error somewhere down the file
- Position cursor in beginning of file
- Trigger “Go to Next Problem” keyboard action (by default
F8
on my machine). - press
l
. - The cursor will move to one character after it was before the keyboard action.
Expected behavior The cursor should be one character after the problem that “Go to Next Problem” jumped to.
Screenshots None
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.17.1
- VSCode version: 1.51.1
- OS: Ubuntu 20.04
Additional context None
As an aside, it would also be nice to have a vim action for “next problem”.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 22 (1 by maintainers)
The issue still exists. In some circumstances movements get broken: the editor shows the movement for several milliseconds then reverts to the previous position. Movements like “normal mode hjkl”, “jump to next git diff” and “clangd goto definition”. Entering insert mode fixes movements, reopening the editor doesn’t.
In what circumstances does the problem occur?
This is an extremely irritating problem which happens all the time (not some corner case), makes normal (the most valuable mode) mode effectively useless in diffs and has been there for the last three years. Please, give it more priority.
I can confirm this issue happens.
Steps to reproduce:
This is still happens on v1.18.9 for me as well. Not only for problems, but also when using “Go to symbol”.
I’m using v1.18.9 of the extension (VSC Insiders, commit
93f705ab
) and I still observe this problem. The cursor visually appears to move when calling “Go to next problem”, but performing a motion (hjkl
) updates the previous location of the cursor.A similar thing occurs if you choose a problem in the “Problems” tab of the lower panel.
I’m using VsCode 1.86.2 and VSCodeVim 1.27.2, Press Shift+Ctrl+P “Toggle Vim Mode” and Again to work around.
This regressed in 1.18.9. I just tried with 1.18.8 and it works there.
I’ve developed a terrible muscle memory of CLICKING after hitting to to next diagnostic to work around this issue. I’m pretty surprised this has been an issue for this long. I’ve only recently moved to VSCode from Vim proper due to tooling fatigue at work and this has been my number one drawback.
Just FYI: I had this issue and ended up here after searching for what was causing it. Closing the editor for that file (actually multiple editors for that file, not sure if relevant) and re-opening seemed to fix it for now as per others’ experience.
I have this issue when using several pieces of core functionality;
Randomly (so it seems) vim will just ignore my new cursor location, and instead move back to the previous position once I do any any action (move around, or go into insert), this is driving me a little crazy
this is back in 1.62.3
This keeps on coming back and it’s driving me crazy. Is there any workaround for this?
Works properly in:
v1.21.6
and is broken inv1.21.7
. Couldn’t there be some kind of regression test for this?Confirmed that installing 1.18.8 fixes.
@berknam Would it be possible to re-open this issue?
Hi, check out the latest commits and build it manually, this problem has been fixed a while ago via[#5250]