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
Save position into jumplist before 'edit' action. #1234
Conversation
I am not sure if we want to do it for every picker. Give me a day to think about it and maybe test it (i actually dont know if thats an issue for find_files, grep_string, etc) |
I get you, I'm not sure if I would want to do it for every picker either. But it would also be tedious to leave a mark for some pickers and not others. Not sure if there is a cleaner way to fix the linked issue. |
I don't know if it makes sense for every picker, but I came across this issue because I want this for document_symbols(), so, limit this only for references() maybe won't be good enough |
Seems people have started to care about this, so I started thinking about it again. Here I added a picker option
I don't provide Other options I considered:
|
I dont like having a config option. We can make it only be a
I want this regardless how this ends. For basically everything inside telescope. OnPromptChange, OnLoaded, OnClose, .... But this is a post release feature, we are still planing, on how we wanna realize it. |
If we're going to make it opts, then why not also make it config? Users can override opts, so if we leave it out of default config, wouldn't just be an undocumented config without a default? |
Yes thats the point. Its can be an undocumented internal thing until we introduce some real event system where we && people can hook stuff into. Because i dont like the solution but we should still fix this issue. I think it doesnt make sense to configure that on a global level but should rather be configured by us here for example: https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/builtin/lsp.lua#L79 |
Only change is I removed
Is this something we want in this PR? This change would require a change to every picker that wants the new behavior, and I don't want to be the one making those choices. |
Sorry for the late response. I added the new option to the mentioned builtins and tested it. Thanks for the PR and your patients :) |
fixes #1038
fixes #1520
Whenever telescope does not sort of edit/selection action, it calls
nvim_win_set_cursor()
, which does not add anything to the jumplist. As noted in the issue, this affectslsp_references
picker. This PR adds the current location to the jumplist, as neovim builtin LSP does when jumping to location.Builtin LSP also adds the current word to the tagstack. I didn't add it in this PR because I don't want to copy and paste code, but if we want it I can quickly add it in.
This change affects all edit/selection actions, and I'm not sure if its desirable in all cases and pickers. Open to discussion.