From 1c50bcd8943e104081090ee1cbaf6e367d75ca4e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 24 Mar 2025 01:35:32 +0100 Subject: rc git: clarify reason for NormalIdle hook When blame and blame-jump invoke "git show" they set a BufCloseFifo hook to display a statusline message and center the viewport. As mentioned in the previous patch (which fixed a copy-paste error), the statusline message does not need a NormalIdle hook. Move it to prevent such errors. --- rc/tools/git.kak | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'rc') diff --git a/rc/tools/git.kak b/rc/tools/git.kak index 59d1b080..0d334625 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -287,10 +287,8 @@ define-command -params 1.. \ evaluate-commands -client ${kak_client} %{ set-option buffer git_blob $(kakquote "$commit:$file_absolute") git blame $(for arg; do kakquote "$arg"; printf " "; done) - hook -once window NormalIdle .* %{ - execute-keys vv - echo -markup -- $(kakquote "{Information}{\\}$message. Press to jump to blamed commit") - } + echo -markup -- $(kakquote "{Information}{\\}$message. Press to jump to blamed commit") + hook -once window NormalIdle .* %{ execute-keys vv } } " show_git_cmd_output show "$commit:$file_relative" exit @@ -754,11 +752,9 @@ define-command -params 1.. \ } END $SQ$SQ print \"execute-keys -client $ENV{client} \${diff_line}g$ENV{cursor_column}l;\"; printf \"evaluate-commands -client $ENV{client} $SQ$SQ$SQ$SQ - hook -once window NormalIdle .* $SQ$SQ$SQ$SQ$SQ$SQ$SQ$SQ - execute-keys vv - echo -markup -- %s - $SQ$SQ$SQ$SQ$SQ$SQ$SQ$SQ - $SQ$SQ$SQ$SQ ;\"," . escape(escape(perlquote(escape(escape(quote($info)))))) . "; + echo -markup -- %s + hook -once window NormalIdle .* %%{ execute-keys vv } + $SQ$SQ$SQ$SQ ;\"," . escape(escape(perlquote(escape(quote($info))))) . "; $SQ$SQ $SQ "; -- cgit v1.2.3