-
Notifications
You must be signed in to change notification settings - Fork 705
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
introduce jump_pattern option #5193
base: master
Are you sure you want to change the base?
Conversation
rc/tools/jump.kak
Outdated
execute-keys ',xs^([^:\n]+):(\d+):(\d+)?<ret>' | ||
# file | ||
# file:line | ||
# file:line:col |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear, file:line:col
and file:line
are already supported.
Whether we want to support file
, maybe, I'm not sure.
Do you have a use case in mind?
Note that it should be possible to create a buffer-local jump
alias to your preferred implementation.
The LSP plugin uses this technique for example.
Also, if you want to support file
, you probably want to do the same to jump-select-next
and jump-select-previous
(also those can be customized by means of aliases).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only support file:line:
currently, it doesn't recognize the pattern without last :
.
One of my use case is that finding some files using fd
or rg -l
, look at them and open some of them. I don't know if there is a better workflow.
define-command -params 1.. -docstring "find files" fd %{
require-module fifo
evaluate-commands -try-client %opt{toolsclient} %{
fifo -name "*fd*" fd -tf %arg{@}
require-module jump
hook buffer NormalKey <ret> jump
}
}
do you think it's a better idea if I extract an option jump_file_pattern
so that I can override it in my command and jump-next/previous can also use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krobelus , I reverted the pattern and introduced an option instead, could you take another look?
Sometime, we don't have line and column information in context, like fd output, log etc.
Let's extract an option
jump_pattern
to let other use cases can override it.