aac552362917fc729c80d191dd387016e39f97a0
- Author
- xiao <xiao.h.fan@gmail.com>
- Committer
- xiao <xiao.h.fan@gmail.com>
- Date
Message
Additional chpwd clobbering fix for dirpersist
Diff
1diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
2index 88d1129d4ac9a21a0a08f1a61f6531b84f320c34..e4590afc6523ead957567894b240073038f5cefe 100644
3--- a/plugins/dirpersist/dirpersist.plugin.zsh
4+++ b/plugins/dirpersist/dirpersist.plugin.zsh
5@@ -11,7 +11,9 @@ if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
6 [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
7 fi
8
9-chpwd() {
10+typeset -ga chpwd_functions
11+chpwd_functions+='chpwd_dirpersist'
12+chpwd_dirpersist() {
13 if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi
14 local -ax my_stack
15 my_stack=( ${PWD} ${dirstack} )