From 85f230bd8f871753fda80f19f57621942968b394 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sun, 13 Dec 2020 04:15:04 +0530 Subject: [PATCH] Fix double cd error --- templates/zsh.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/zsh.txt b/templates/zsh.txt index 538f06a..acb900b 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -59,9 +59,7 @@ function __zoxide_z() { echo "zoxide: \\$OLDPWD is not set" return 1 fi - elif [ "$#" -eq 1 ] && cd "$1" &>{{ Opts::DEVNULL }}; then - __zoxide_cd "$1" - else + elif ! { [ "$#" -eq 1 ] && __zoxide_cd "$1" &>{{ Opts::DEVNULL }}; }; then local __zoxide_result __zoxide_result="$(zoxide query -- "$@")" && __zoxide_cd "$__zoxide_result" fi