Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jump list not taken into account with auto_jump #143

Closed
dessaya opened this issue Dec 21, 2021 · 5 comments · Fixed by #277
Closed

jump list not taken into account with auto_jump #143

dessaya opened this issue Dec 21, 2021 · 5 comments · Fixed by #277

Comments

@dessaya
Copy link

dessaya commented Dec 21, 2021

When jumping with Trouble lsp_definitions having auto_jump enabled, the jump list is not taken into account. Pressing <C-o> should take the cursor back to the original position; instead it goes to whatever was on the jump list before that.

I think this only happens when jumping in the same file, not when jumping across different files.

@JulesNP
Copy link

JulesNP commented Oct 18, 2022

I'm currently working around this issue by manually setting a jumplist location before calling trouble:

function()
    vim.cmd [[normal m']]
    trouble.close()
    trouble.open "lsp_definitions"
end

@Aex12
Copy link

Aex12 commented Feb 8, 2023

Same issue here. It's so frustrating. At the moment I just use the builtin 'vim.lsp.buf.definition' lua function to jump to definitions and use a different binding to use Trouble

@Hubro
Copy link

Hubro commented Apr 17, 2023

So THIS is the cause! The last couple of months this has frustrated the hell out of me, sometimes my "previous position" is just the top of the current file, meaning I completely lose my flow. It only dawned on me today that this happens whenever I "go to definition" (gd).

This issue has been open since 2021, I guess I'm setting my LSP mappings back to default 😆

@Hubro
Copy link

Hubro commented Apr 18, 2023

I stand corrected

@folke
Copy link
Owner

folke commented Apr 18, 2023

Yeah, sorry for the delay. I actualy use Telescope's go to definition myself, so didn't have this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants