Plugins like LSP clients are now using settagstack to replicate the behavior of C-], but the provided API only allows replacing the entire stack or appending to it, which makes it non-trivial to replicate the native tagstack behavior.
Natively, jumping to a tag will insert the new tag at the current index, and remove everything that came after it. This allows "tree like" navigation through tags, by using C-T to go up in the stack and then jumping to a different tag branching off in a different direction.
I think settagstack should have a third mode to replace the tagstack entries from the current index up to the end, so as to easily replicate native tag navigation. Without this mode, plugin authors either manually reimplement it as in vim-lsp, or simply use append without being aware of the difference in behavior.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Use tagfunc
Can't you get the existing stack with gettagsack() and modify it any way
before using settagstack() ?
Yes, this is what vim-lsp is doing. I'm trying to say that since it will almost always be the right thing to do, the functionality should exist out of the box.
—
That's what I had in mind yes!
That's what I had in mind yes!
included as of https://github.com/vim/vim/releases/tag/v8.2.0077
—
You are receiving this because you commented.
Plugins like LSP clients are now using
settagstackto replicate the behavior ofC-], but the provided API only allows replacing the entire stack or appending to it, which makes it non-trivial to replicate the native tagstack behavior.Natively, jumping to a tag will insert the new tag at the current index, and remove everything that came after it. This allows "tree like" navigation through tags, by using
C-Tto go up in the stack and then jumping to a different tag branching off in a different direction.I think
settagstackshould have a third mode to replace the tagstack entries from the current index up to the end, so as to easily replicate native tag navigation. Without this mode, plugin authors either manually reimplement it as in vim-lsp, or simply use append without being aware of the difference in behavior.