only add dirpersiststore to zshexit hook when dirstackhandling is active
authorJoerg Jaspert <joerg@debian.org>
Sat, 13 Apr 2013 14:29:19 +0000 (16:29 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sat, 13 Apr 2013 14:29:19 +0000 (16:29 +0200)
.zsh/05_Functions.zsh
.zsh/10_Environment.zsh

index 215680d..151d53c 100644 (file)
@@ -78,12 +78,6 @@ function dirpersiststore () {
     print -l ${(Oau)dirstack} ${PWD} >| ${DIRSTACKFILE}
 }
 
-if is434; then
-    add-zsh-hook zshexit dirpersiststore
-else
-    echo "Sorry, zsh version too old"
-fi
-
 function agent() {
     local agent agentfiles af
     local _agent_ssh_env=${HOME}/.ssh/agentenv.${HOST}
index 57986e6..3939b41 100644 (file)
@@ -18,6 +18,11 @@ DIRSTACKSIZE=20
 if zstyle -t ':ganneff:config' dirstackhandling dirpersist dirstack; then
     DIRSTACKFILE=${ZDOTDIR}/var/.zdirstore
     dirpersistrestore
+    if is434; then
+        add-zsh-hook zshexit dirpersiststore
+    else
+        echo "Sorry, zsh version too old"
+    fi
 fi
 
 if zstyle -t ':ganneff:config' doagent; then