Describe the bug
For some symbols, 'gd' jumps to the end of the file containing the real definition. Following c-o will jump back to the beginning of the file.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
F12 and Alt+Left Arrow works correctly. 'gd' and c-o should jump to the correct locations.
Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Here is the log in the developers console when I hit the bug:
[Extension Host] ModeHandler: debug: handling key=g.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=g. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=g. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=d.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=d. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=d. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor position. [ [2555, 56] | [2555, 56]].
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor start position. [2555, 56].
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor stop position. [2555, 56].
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor start position. [2555, 56].
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=
workbench.main.js:238 [Extension Host] getCursorsAfterSync: warn: getCursorsAfterSync: selection not updated within 0ms.
[2555,56] is acutally the line and column where I pressed 'gd'. The first warning is triggered about 3 seconds after the cursor jumps to the correct location.
I thing this is a "codelen" problem. I prevented this problem by closeing codelen .
setting.json
"editor.codeLens": false,
See the codelen feature in release notes: 1.34.0
And I found all move 'j', 'k', 'c-d' etc will be obvious delayed after 'gd'. The native go-to-definition(f12) has not this trouble. Hope to improve this so that I don't have to wait a few milliseconds before moving.
I'm also seeing this behaviour. disabling code lens fixes it for me but I use code lens all the time so I'd rather not disable it. i was able to solve the problem by mapping over the gd command, (and adding a gp command for fun):
{
"before": ["g", "p"],
"commands": ["editor.action.peekDefinition"]
},
{
"before": ["g", "d"],
"commands": ["editor.action.revealDefinition"]
},
This work-around, rebinding gd in the proposed way seems to work fine for me, too.
Same issue, but unfortunately, rebinding gd doesn't work for me. Does anyone have any other workaround?
Most helpful comment
I'm also seeing this behaviour. disabling code lens fixes it for me but I use code lens all the time so I'd rather not disable it. i was able to solve the problem by mapping over the gd command, (and adding a gp command for fun):