Vim icon indicating copy to clipboard operation
Vim copied to clipboard

[CURSOR] Go to function definition using "CTRL" + "]"

Open 0xCodeMaieutics opened this issue 10 months ago • 2 comments

Describe the bug Vim plugin in cursor behaves weirdly when you try to go to the function definition and go back to the function usage.

It's almost storing the old state of "going to the function definition" and when you try to click on any other keyboard after "CTRL" + "]", vim is throwing you to the same function definition.

To Reproduce Steps to reproduce the behavior:

  1. Put cursor position on a function usage.
  2. Use the following key combo: "CTRL" + "]"
  3. It will bring you to the function definition
  4. If you click on "CTRL" + "]" vim is going to bring you back to that function usage.
  5. Now, try to switch from normal mode to insert mode.
  6. Vim is going to bring you back to the function definition even though that was not your intention.

Expected behavior Vim shouldn't be forcing you to go to the function definition after you went there on your own using "CTRL" + "]" and now you just want to switch to insert mode.

Screenshots

Cursor starting position: Image

After hitting the following key combo "CTRL" + "]": Image

After hitting the key combo again:

Image

And now press "i" for switching to insert mode and vim is forcing you to go to the function def. again and put you in insert mode there:

Image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.29.0
  • VSCode version: 0.48.7
  • OS: MacOS, 14.6.1

Additional context

In VSCode Vim plugin works perfectly as expected but something weird is going on in Cursor IDE I can't figure out how to find a work around this.

0xCodeMaieutics avatar Apr 05 '25 09:04 0xCodeMaieutics

Likely duplicate of https://github.com/VSCodeVim/Vim/issues/9195

I don't think it's storing the old position. I think it's failing to recognise the new position.

I get this in VSCode too, but only if the definition is in the same file as the original position.

joeytwiddle avatar May 08 '25 15:05 joeytwiddle

@joeytwiddle thanks for referencing the duplication.

0xCodeMaieutics avatar May 13 '25 14:05 0xCodeMaieutics