1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-29 10:02:57 +03:00

rc diff: plug register leak

Commit 36efbf4cb (rc filetype diff: extract diff parsing from
diff-jump, 2024-02-03) moved the "set-register |" command but failed
to move the "-save-regs |".  This surfaces as register leakage in
"git blame-jump". Fix that.
This commit is contained in:
Johannes Altmanninger 2024-02-25 17:43:10 +01:00 committed by Maxime Coste
parent 8a7641284c
commit b8f76c6e1a

View File

@ -29,7 +29,7 @@ define-command diff-jump -params .. -docstring %{
- jump to the old file instead of the new file - jump to the old file instead of the new file
-<num> strip <num> leading directory components, like -p<num> in patch(1). Defaults to 1 if there is a 'diff' line (as printed by 'diff -r'), or 0 otherwise. -<num> strip <num> leading directory components, like -p<num> in patch(1). Defaults to 1 if there is a 'diff' line (as printed by 'diff -r'), or 0 otherwise.
} %{ } %{
evaluate-commands -draft -save-regs c| %{ evaluate-commands -draft -save-regs c %{
# Save the column because we will move the cursor. # Save the column because we will move the cursor.
set-register c %val{cursor_column} set-register c %val{cursor_column}
# If there is a "diff" line, we don't need to look further back. # If there is a "diff" line, we don't need to look further back.
@ -93,7 +93,7 @@ define-command diff-jump -params .. -docstring %{
complete-command diff-jump file complete-command diff-jump file
define-command -hidden diff-parse -params 2.. %{ define-command -hidden diff-parse -params 2.. %{
evaluate-commands -save-regs ae %{ evaluate-commands -save-regs ae| %{
set-register a %arg{@} set-register a %arg{@}
set-register e nop set-register e nop
set-register | %{ set-register | %{