Describe the bug
VSCodeVim doesn't always update cursor location when user changes it using VSCode (by clicking on a line / cycling through VSCode search results).
NOTE 1: This started with v1.17.0, I tested v1.16.0 and it works fine.
NOTE 2: This happens to me about 60% of the time, a few times I tried it worked fine, still really easy to reproduce
To Reproduce
Steps to reproduce the behavior:
Or:
Expected behavior
Cursor location representation in VSCodeVim should be updated when it's moved to a different location using VSCode tools
Environment (please complete the following information):
Additional context
As mentioned above, this started with 1.17.0 (1.16.0 is fine). Something appears to be wrong with this version
Experiencing same issue.
hjkl movements seem to use the cursor-selected position.
But commands like x or dd will use the prior position.
Also reported in #5212
Experiencing same issue to :confused:
hjklwebf{} commands do not use cursor-selected position. Looks for me like noting uses cursor-selected position

Can any of you post your logs here like explained here?
I'm having this same issue. This borderline breaks the extension, making it nearly unusable.
I'm pretty sure this is happening because of an issue of multicursor selections that might happen when using snippets, that makes it so that all selection changes are ignored, and the only way to fix it is either close and reopen the file or reloading the window.
If someone can post their logs I might be able to confirm that. I have a fix for the issue I mentioned that I will try to push soon.
Can anyone here test PR #5250 to see if it fixes this issue and report back?
It's not even only on "mouse click". It's a more serious issue, as it breaks serious features of VSCode itself like "Ctrl+Shift+O" (Search by symbol/functions/variables), which move Code's cursor. Now it's almost a useless feature, and it's one I'm using a lot.
Steps to reproduce
Ctrl+Shift+OjklhVersions


@exapsy If you close and reopen vscode or if you run the "Reload Window" from command palette can you still reproduce that? Or does it only start happening after some use?
Because I can't reproduce that. I know there is at least a situation that can leave VSCodeVim in a status that makes it behave like explained here. And that is what I tried to fix with PR #5250, if you can, test it out and give some feedback.
@berknam No you're right. If you reload the window it doesn't happen. But now, I'm not sure how to reproduce it consistently to test your PR. I just know that it will happen again very soon, but not sure why. Any ideas on how to reproduce it?
It might happen when using snippets but I know for sure that if you create two or more multicursors in visual mode and then move them until they combine together it would create that situation. Like this:
line |1
line |2
line 3
line 4
Where | are the cursors. If you then do viw to select 1 and 2 and then press j it would get you in that situation.
Possibly related to this: using Ctrl + Left or Right Arrow key to move cursor over words does not update the vim cursor. Using v1.17.1 (which fixes a bunch of the other issues such as mouse clicks not updating the vim cursor).
Possibly related to this: using Ctrl + Left or Right Arrow key to move cursor over words does not update the vim cursor. Using v1.17.1 (which fixes a bunch of the other issues such as mouse clicks not updating the vim cursor).
Yes. If you are in the state where this is happening then any change of selection/cursor that is not made directly through Vim will not be recognized. For now until #5250 is released the only way to fix it is reloading the window or restarting vscode (actually closing the affected documents and reopening them might work as well, haven't tested it yet)
Same for me using Ctrl+Arrow keys to move around, then when I press I, the insert will be at the location I was when I first started moving using Ctrl keys. Attaching a gif of the issue.
