Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Weird jumps

Open femans opened this issue 2 years ago • 8 comments

Describe the bug Often when the cursor is clearly somewhere in a document, and I press one of hte arrow keys or pageup/pagedown, the cursor jumps to the beginning of the document. If I do a combination like dd, it even removes the first line of the document in stead of the line of the cursor. Also, when I use end to jump to the end of the line, it does this, but then if I start typing or editing, it jumps back to where it came from.

To Reproduce I wish I knew. It just happens randomly and a lot.

Expected behavior Edit and move from where I see the cursor.

Environment (please complete the following information):

  • Extension (VsCodeVim) version:
  • VSCode version: 1.25.2
  • OS: ubuntu

Additional context Unfortunately I had to disable the plugin because it becomes unworkable. Which may even mean I have to switch out vscode for something else.

femans avatar May 08 '23 19:05 femans

Yes I am also facing this every time and it is super annoying.

Steps to reproduce:

  1. Use page up/down.
  2. Move cursor with arrow keys or h/j/k/l The control goes back to where it started.

VSCode version: 1.78.0 vscodevim version: 1.25.2 OS: Windows 10

iN5iNN3R470R avatar May 10 '23 07:05 iN5iNN3R470R

I frequently use vscode's Go Back command instead of ctrl+o, because the emulation of this feature in this extension does not work very well, and the issue reported here affects me a lot now because of this. After using Go Back and then pressing h/j/k/l, the cursor goes back to where it was before Go Back was used, then moves.

Steps to reproduce:

  1. Use vscode's command Go Back (I map it to Alt + left arrow)
  2. Move cursor with arrow keys or h/j/k/l The control goes back to where it started.

VSCode version: 1.78.2 vscodevim version: 1.25.2 OS: Ubuntu

eduardomezencio avatar May 26 '23 20:05 eduardomezencio

also encountered the same problem

ghrejoe avatar Jun 08 '23 11:06 ghrejoe

I run into this every once in a while when doing anything that jumps around the file (symbol search, next/prev error, git diffs, ect.). Closing and reopening the file seems to fix it - but I also found if you start gb and cancel, the cursor won't jump back (which makes me wonder if it's somehow related to multi-cursors). Great for not having to context switch whenever this happens.

Example settings.json to do this quickly + cancel out the forward movement:

"vim.normalModeKeyBindingsNonRecursive": [
    { "before": [ "<leader>", "<CR>" ], "after": [ "g", "b", "<Esc>", "b" ] }
]

ccastanedaucf avatar Aug 06 '23 09:08 ccastanedaucf

Also get this, one way to reproduce this

  • search for something with VSCodes search (CMD+f)
  • Enter through the search results
  • Press esc (to dismiss the VSCode search)
  • Do any VIM action (escape, go to insert mode, anything at all) => Cursor jumps back to where it was before you started searching.

I feel like this bug has been around for years, and it seems to come and go, but once it starts to appear it happens consistently. Makes the VSCode search unusable, would love to know if somebody has a workaround.

mattijauhiainen avatar Aug 09 '23 04:08 mattijauhiainen

Duplicate of #8200?

iinuwa avatar Aug 14 '23 12:08 iinuwa

I ran into this today (2024-09-07) via Find.

After closing the Find window, now with my cursor on the line I wished to find, if I press esc, ctrl-c or any motion key, the cursor jumps back to where it was when I invoked the Find function.

Indeed, reopening the file made the problem go away.

cpbotha avatar Sep 07 '24 10:09 cpbotha

Closing and reopening the file seems to fix it

You can bind a keyboard shortcut (it it's not in use) to reload editor tab at keybindings.json. Example:

  {
    "key": "shift+alt+t",
    "command": "runCommands",
    "args": {
      "commands": [
        "workbench.action.closeActiveEditor",
        "workbench.action.reopenClosedEditor"
      ]
    }
  }

d9k avatar Oct 02 '24 08:10 d9k