diff options
| author | Caleb Heuer <ch@raiguard.me> | 2023-06-16 17:57:51 -0600 |
|---|---|---|
| committer | Caleb Heuer <ch@raiguard.me> | 2023-06-16 17:57:51 -0600 |
| commit | 54c933308d44124ac6b0ec5d8dd6c72de488bb5e (patch) | |
| tree | 501d2c452f9e9093806b02baa4df1c59db943970 | |
| parent | 388cd248a4dae62280a57d27194b12bc13084b5f (diff) | |
Remove file if harpoons are empty
| -rw-r--r-- | harpoon.kak | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/harpoon.kak b/harpoon.kak index bd0ca90..282a4d3 100644 --- a/harpoon.kak +++ b/harpoon.kak @@ -105,6 +105,10 @@ hook global KakBegin .* %{ hook global KakEnd .* %{ evaluate-commands %sh{ + if [ -z "$kak_quoted_opt_harpoon_files" ]; then + rm -f "$kak_opt_harpoon_state_file" + exit + fi printf "$kak_quoted_opt_harpoon_files" > "$kak_opt_harpoon_state_file" } } |
