summaryrefslogtreecommitdiff
path: root/harpoon.kak
diff options
context:
space:
mode:
Diffstat (limited to 'harpoon.kak')
-rw-r--r--harpoon.kak4
1 files changed, 4 insertions, 0 deletions
diff --git a/harpoon.kak b/harpoon.kak
index 3a8f1c3..def4dbd 100644
--- a/harpoon.kak
+++ b/harpoon.kak
@@ -112,6 +112,10 @@ define-command -hidden harpoon-save %{
define-command -hidden harpoon-check %{
evaluate-commands %sh{
+ # Ignore scratch files
+ if [ -z "${kak_buffile%\**\*}" ]; then
+ exit
+ fi
git_branch=$(git -C "${kak_buffile%/*}" rev-parse --abbrev-ref HEAD 2>/dev/null)
state_file=$(printf "%s" "$PWD-$git_branch" | sed -e 's|_|__|g' -e 's|/|_-|g')
state_dir=${XDG_STATE_HOME:-~/.local/state}/kak/harpoon