diff --git a/rc/grep.kak b/rc/grep.kak index a009dad2..15a70332 100644 --- a/rc/grep.kak +++ b/rc/grep.kak @@ -34,14 +34,16 @@ hook global WinSetOption filetype=(?!grep).* %{ rmhl grep; rmhooks buffer grep-h decl str jumpclient -def jump %{ - exec 'xs^((?:\w:)?[^:]+):(\d+):(\d+)?' - set buffer _grep_current_line %val{cursor_line} - eval -try-client %opt{jumpclient} edit -existing %reg{1} %reg{2} %reg{3} - try %{ focus %opt{jumpclient} } +def grep-jump %{ + try %{ + exec 'xs^((?:\w:)?[^:]+):(\d+):(\d+)?' + set buffer _grep_current_line %val{cursor_line} + eval -try-client %opt{jumpclient} edit -existing %reg{1} %reg{2} %reg{3} + try %{ focus %opt{jumpclient} } + } } -def next -docstring 'Jump to next grep match' %{ +def grep-next -docstring 'Jump to next grep match' %{ eval -try-client %opt{jumpclient} %{ buffer '*grep*' exec "%opt{_grep_current_line}g/^[^:]+:\d+:" @@ -49,7 +51,7 @@ def next -docstring 'Jump to next grep match' %{ } } -def prev -docstring 'Jump to previous grep match' %{ +def grep-prev -docstring 'Jump to previous grep match' %{ eval -try-client %opt{jumpclient} %{ buffer '*grep*' exec "%opt{_grep_current_line}g^[^:]+:\d+:"