diff options
Diffstat (limited to 'plugins/dirhistory')
-rw-r--r-- | plugins/dirhistory/dirhistory.plugin.zsh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 504d7ec14..0209981e3 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -3,7 +3,7 @@ # that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT. # -dirhistory_past=(`pwd`) +dirhistory_past=($PWD) dirhistory_future=() export dirhistory_past export dirhistory_future @@ -49,8 +49,9 @@ function push_future() { } # Called by zsh when directory changes -function chpwd() { - push_past `pwd` +chpwd_functions+=(chpwd_dirhistory) +function chpwd_dirhistory() { + push_past $PWD # If DIRHISTORY_CD is not set... if [[ -z "${DIRHISTORY_CD+x}" ]]; then # ... clear future. @@ -73,7 +74,7 @@ function dirhistory_back() { pop_past cw if [[ "" == "$cw" ]]; then # Someone overwrote our variable. Recover it. - dirhistory_past=(`pwd`) + dirhistory_past=($PWD) return fi |