From da1c302a37c00cdcc16da4c1f292ccbeecfd181b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 19 Apr 2024 16:49:58 +1000 Subject: [PATCH] Make grep-(next|prev)-match use the latest buffer matching \*grep(-.*)\* --- rc/tools/grep.kak | 4 ++-- rc/tools/jump.kak | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rc/tools/grep.kak b/rc/tools/grep.kak index 79931c0a..13b5b9c3 100644 --- a/rc/tools/grep.kak +++ b/rc/tools/grep.kak @@ -54,11 +54,11 @@ define-command -hidden grep-jump %{ } define-command grep-next-match -docstring %{alias for "jump-next *grep*"} %{ - jump-next *grep* + jump-next -matching \*grep(-.*)?\* } define-command grep-previous-match -docstring %{alias for "jump-previous *grep*"} %{ - jump-previous *grep* + jump-previous -matching \*grep(-.*)?\* } } diff --git a/rc/tools/jump.kak b/rc/tools/jump.kak index 51d0bca2..60d777d4 100644 --- a/rc/tools/jump.kak +++ b/rc/tools/jump.kak @@ -21,17 +21,17 @@ define-command -hidden jump %{ } } -define-command jump-next -params 1 -docstring %{ +define-command jump-next -params 1.. -docstring %{ jump-next : jump to next location listed in the given *grep*-like location list buffer. } %{ evaluate-commands -try-client %opt{jumpclient} -save-regs / %{ - buffer %arg{1} + buffer %arg{@} jump-select-next jump } try %{ evaluate-commands -client %opt{toolsclient} %{ - buffer %arg{1} + buffer %arg{@} execute-keys gg %opt{jump_current_line}g } } @@ -44,17 +44,17 @@ define-command -hidden jump-select-next %{ execute-keys ge %opt{jump_current_line}g /^[^:\n]+:\d+: } -define-command jump-previous -params 1 -docstring %{ +define-command jump-previous -params 1.. -docstring %{ jump-previous : jump to previous location listed in the given *grep*-like location list buffer. } %{ evaluate-commands -try-client %opt{jumpclient} -save-regs / %{ - buffer %arg{1} + buffer %arg{@} jump-select-previous jump } try %{ evaluate-commands -client %opt{toolsclient} %{ - buffer %arg{1} + buffer %arg{@} execute-keys gg %opt{jump_current_line}g } }