diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2025-03-23 15:58:57 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-03-24 08:23:59 +1100 |
| commit | 43782d0ca11b4eff14ff3ab8274de20140f3567c (patch) | |
| tree | 81a74484387481623c13e19f5a708931556dd914 /rc | |
| parent | daaa32104fcbafdecd2f6eec15975dca3b7cc665 (diff) | |
rc git: fail blame-jump explicitly when there is no client
My
kak -e 'hook global WinCreate /.* %{ git blame-jump }; edit README.asciidoc'
hangs until I cancel it with <c-c>.
The error is
error while waiting for shell: 1:1: 'evaluate-commands': 3:21: 'execute-keys': no such client: '-draft'
git blame-jump cannot do anything useful without a client in context, so
fail early and explicitly.
Diffstat (limited to 'rc')
| -rw-r--r-- | rc/tools/git.kak | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rc/tools/git.kak b/rc/tools/git.kak index b4be1973..eb7657b5 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -561,6 +561,10 @@ define-command -params 1.. \ } blame_jump() { + if [ -z "${kak_client}" ]; then + echo fail git blame-jump: no client in context + exit + fi echo >${kak_command_fifo} "echo -to-file ${kak_response_fifo} -- %opt{git_blame}" blame_info=$(cat < ${kak_response_fifo}) blame_index= |
