From fec7ba6f90f5cf42d29652148a5590c9400328df Mon Sep 17 00:00:00 2001 From: Sendy Halim Date: Fri, 14 Oct 2016 10:43:40 +0700 Subject: [PATCH] Use equality operator to check if in home directory --- plugins/last-working-dir/last-working-dir.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index e882b288f..1586e67e5 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -16,8 +16,8 @@ lwd() { # Jump to last directory automatically unless: # - this isn't the first time the plugin is loaded -# - it's not in $HOME directory +# - it's in $HOME directory [[ -n "$ZSH_LAST_WORKING_DIRECTORY" ]] && return -[[ "$PWD" != "$HOME" ]] && return +[[ "$PWD" == "$HOME" ]] && return lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true