Make the :jump-next and :jump-previous commands remember the last used jump buffer#5403
Make the :jump-next and :jump-previous commands remember the last used jump buffer#5403silversquirl wants to merge 1 commit intomawww:masterfrom
Conversation
989bae8 to
baf29a1
Compare
| try %{ | ||
| evaluate-commands -client %opt{toolsclient} %{ | ||
| buffer %arg{@} | ||
| buffer %opt{jump_current_buffer} |
There was a problem hiding this comment.
as written, this breaks users who override jump in buffer scope,
for example the kakoune-lsp plugin
creates some scratch buffers with
alias buffer jump "%val{hook_param_capture_1}-jump"
where the rhs can be one of
lsp-goto-jump
lsp-document-symbol-jump
lsp-diagnostics-jump
which are not aware of %opt{jump_current_buffer}
So it seems if we want this, we should set jump_current_buffer outside jump because that's intended to be overridden (as are jump-select-next and jump-select-previous).
Overall I'm not sure if this PR is worth it. It introduces extra implicit state.
Consider that other commands like :buffer have no memory either; but we do have generic command history which should cover some of your need.
I'm not against DWIM but it can be a lot of work to get right.
Does the jump-next -matching ... approach not work for the same use case?
We should definitely document that better.
|
This use case is already catered for but I realize this is not really documented:
In other words, with the suggested previous command, the latest buffer that matches the regex will be used for jumping, so if you do a |
Useful to allow bindings that work for any plugin that uses a jump buffer :)