5f0729f155
When running git blame in a "git show" buffer, we annotate the youngest version of the file that has the line referenced by the diff line at cursor. In case the cursor is on an added or context line, we simply show the version from the surrounding commit. When the cursor is on a deleted line, we show the parent commit, which still has the deleted line. However there is a bug: we use the line number in the new version of the file. Fix that.
15 lines
381 B
Plaintext
15 lines
381 B
Plaintext
declare-option str jumpclient
|
|
source "%val{runtime}/rc/filetype/diff.kak"
|
|
source "%val{runtime}/rc/tools/git.kak"
|
|
|
|
define-command run %{
|
|
git init
|
|
git add
|
|
git commit --message 'initial commit'
|
|
execute-keys %{2gIchanged <esc>}
|
|
write
|
|
git commit --all --message 'changed line 2'
|
|
# Show the commit, jumping to the new version of line 2.
|
|
git blame-jump
|
|
}
|