helix
helix copied to clipboard
Lsp goto other window (fixes 3167)
I inadvertently closed the prior PR with these same commits via some failed git-fu.
Anyhow, its back up now.
This addresses the #3167 issue I made.
For picker related selections I have added a ctrl!('o') keybind in the picker that will load into the "other" window, via adding a new Action variant for editor.switch to match onto, which just calls focus_next() and then switch() recursively with Action::Replace.
For Goto defintion, since it has a unique destination and no Picker interaction, I just add a command that can be accessed directly if someone adds the command to their keymap. In my personal keymap I bind that to D whereas lowercase d is goto definition in the same view.
Thanks @dead10ck , made those suggested changes. Cheers! Dave
Going to close this as I found a simpler approach via the config! I was inspired to try the config approach after trying to catch up onto master and the rebase wasn't going to be as straight forward as it had been for a while.
@bnjbvr this will always show definition in other pane, as opposed to using D vs d. I pretty much always want to keep my place in the source file anyways when looking for a definition so this works for me...
g = {d = ["goto_definition", "rotate_view"]}