VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.97k stars 1.32k forks source link

"go to definition", etc go to the right line, but wrong column #3102

Open captaincaius opened 6 years ago

captaincaius commented 6 years ago

Describe the bug using "go to definition" doesn't seem to update the column - it keeps the previous column.

To Reproduce Steps to reproduce the behavior:

  1. Click on a function call
  2. Right-click
  3. "go to definition"
  4. Notice the column LOOKS correct
  5. Move cursor using hjkl
  6. Notice the cursor column jumps to where you were before the "go-to-definition", but on the correct line.

Expected behavior The column is in-sync just like the row

Screenshots

Environment (please complete the following information):

Additional context None

jpoon commented 5 years ago

Definitely need a repro. I've been debugging a separate issue with 'gd' (go to definition) and have not come across the (incorrect) behaviour you are describing.

captaincaius commented 5 years ago

I just tried reproducing it and finally got it to do it again. Even on the same definition it doesn't seem to be consistent. I'll try to figure out what the variable that causes it to happen and report back. If I can't, maybe I'll try to send a little animation instead.

captaincaius commented 5 years ago

ok so it seems wayyy less severe than it used to be when I first posted this. Something must have partially fixed it - before I remember sometimes I'd go to a definition and do "cw" or something and it would start replacing in the wrong place. Now I can't get it to do that.

Now it can only be reproduced if you go up or down using j or k after gd. In that sense it's not a super big deal anymore. But for completeness sake I'll post a few screenshots for you. It'll even happen if you gd from the symbol itself.

start: image

after "gd": image

after "j": image

^ notice the column jump.

jpoon commented 5 years ago

Ah, very nice. I can repro. Column is definitely incorrect following a gd.

zhuzisheng commented 5 years ago

I can't reproduce this issue on window with the latest version 0.17.3. Is this issue only reproduced on linux?

captaincaius commented 5 years ago

wow. i haven't tested it on windows, but yes - I for one am on linux.

jpoon commented 5 years ago

I was able to repro on Windows.

zhuzisheng commented 5 years ago

1 I try with version 0.17.3 on windows. first use "gd" then "j"...

jpoon commented 5 years ago

Was planning on working on this bug but I can't repro on my machine anymore :/

rahulbansal16 commented 3 years ago

I am sorry to ask it over here, is there any shortcut to go to the function usage?