From efaf9ab4e2d61a5346c7f97312b66d6fedd5a1c9 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 25 Feb 2024 17:56:38 +0100 Subject: [PATCH] rc git: fix off-by-one in git blame cursor target I personally mostly use "git blame-jump" so this "git blame" bug has flown under the radar. When we run git blame in a git-diff buffer, we want to move one column to the left since the lines in the target blob don't have the +- prefix. We already subtract one but we add it back accidentally when using "l" to go to this column. Fix it. In future we should try to preserve more of the selection(s), not just the main cursor. --- rc/tools/git.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/tools/git.kak b/rc/tools/git.kak index 1f8089483..c80dc702d 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -260,7 +260,7 @@ define-command -params 1.. \ message="Blaming $file as of $(git rev-parse --short $commit)" echo "echo -debug -- $(kakquote "$message")" on_close_fifo=" - execute-keys -client ${kak_client} ${cursor_line}g${cursor_column}l + execute-keys -client ${kak_client} ${cursor_line}g${cursor_column}lh evaluate-commands -client ${kak_client} %{ set-option buffer git_blob $(kakquote "$commit:$file") git blame $(for arg; do kakquote "$arg"; printf " "; done)