From 54c933308d44124ac6b0ec5d8dd6c72de488bb5e Mon Sep 17 00:00:00 2001 From: Caleb Heuer Date: Fri, 16 Jun 2023 17:57:51 -0600 Subject: Remove file if harpoons are empty --- harpoon.kak | 4 ++++ 1 file changed, 4 insertions(+) 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" } } -- cgit v1.2.3