From 649e252f75122de13b395f503508c9a91969e7fa Mon Sep 17 00:00:00 2001 From: Vladimir Bauer Date: Fri, 14 Aug 2020 00:52:22 +0500 Subject: [PATCH] bring *grep* buffer to front in context of toolsclient --- rc/tools/grep.kak | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rc/tools/grep.kak b/rc/tools/grep.kak index 7233d02e..39aecf19 100644 --- a/rc/tools/grep.kak +++ b/rc/tools/grep.kak @@ -53,13 +53,18 @@ define-command -hidden grep-jump %{ define-command grep-next-match -docstring 'Jump to the next grep match' %{ evaluate-commands -try-client %opt{jumpclient} %{ buffer '*grep*' - # First jump to enf of buffer so that if grep_current_line == 0 + # First jump to end of buffer so that if grep_current_line == 0 # 0g will be a no-op and we'll jump to the first result. # Yeah, thats ugly... execute-keys "ge %opt{grep_current_line}g /^[^:]+:\d+:" grep-jump } - try %{ evaluate-commands -client %opt{toolsclient} %{ execute-keys gg %opt{grep_current_line}g } } + try %{ + evaluate-commands -client %opt{toolsclient} %{ + buffer '*grep*' + execute-keys gg %opt{grep_current_line}g + } + } } define-command grep-previous-match -docstring 'Jump to the previous grep match' %{ @@ -69,5 +74,10 @@ define-command grep-previous-match -docstring 'Jump to the previous grep match' execute-keys "ge %opt{grep_current_line}g ^[^:]+:\d+:" grep-jump } - try %{ evaluate-commands -client %opt{toolsclient} %{ execute-keys gg %opt{grep_current_line}g } } + try %{ + evaluate-commands -client %opt{toolsclient} %{ + buffer '*grep*' + execute-keys gg %opt{grep_current_line}g + } + } }