Open ivnsch opened 2 years ago
It seems that this happens only when mixing vim navigation with trackpad/mouse. I often use the integrated terminal to compile, and since it's not possible to use shortcuts to navigate there, I use the trackpad. And coming to the code from clicking links on the terminal, it's more natural to navigate further with CMD+click than click+ctrl+]
(especially since clicking on the terminal error often doesn't lead to exactly what I want to navigate into).
Not sure whether there's a good solution for this - would it make sense to add non-vim navigation (CMD+click
) to the vim history? So it's possible to navigate back using vim shortcuts? Otherwise I'll try to rely mainly on the errors view instead of the terminal, which should be easier to navigate with the keyboard Update: At least with Rust / rust-analyzer this view isn't always up to date (especially when the errors are in tests), so not an option.
I have the same problem very often. I think solving this problem would be a nice improvement.
By default, jumping to a definition then jumping back would jump to the previously open file.
Adding this to keybindings.json (Settings > Open Keyboard Shortcuts (JSON)) works better for me.
{
"key": "ctrl+o",
"command": "workbench.action.navigateBack",
"when": "editorTextFocus && vim.active && vim.use<C-o> && !inDebugRepl"
}
@nullxone what does that address exactly? if the cursor changes file, navigation should go back (or forth) between files too of course.
I use
ctrl+o
to jump to the last cursor location (often in combination withctrl+]
to navigate). But sometimesctrl+o
will jump to some unexpected place. Is this a known issue? Haven't paid much attention yet to how exactly it fails - will add more information if I have any.