1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-08-16 16:20:38 +03:00

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.
This commit is contained in:
Johannes Altmanninger 2024-02-25 17:56:38 +01:00 committed by Maxime Coste
parent ae21b3a10d
commit efaf9ab4e2

View File

@ -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<a-h>${cursor_column}l
execute-keys -client ${kak_client} ${cursor_line}g<a-h>${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)