diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2024-02-25 17:56:38 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-02-26 19:07:39 +1100 |
| commit | efaf9ab4e2d61a5346c7f97312b66d6fedd5a1c9 (patch) | |
| tree | 7a999c718275221790a70bfa0b68b1b8dfde40d9 /rc | |
| parent | ae21b3a10dac95df4edcf85150eab98939a281af (diff) | |
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.
Diffstat (limited to 'rc')
| -rw-r--r-- | rc/tools/git.kak | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rc/tools/git.kak b/rc/tools/git.kak index 1f808948..c80dc702 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<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) |
