summaryrefslogtreecommitdiff
path: root/plugins/zsh-navigation-tools/n-cd
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2016-05-18 19:20:39 -0700
committerRobby Russell <robby@planetargon.com>2016-05-18 19:20:39 -0700
commit841d2b928704b4f8b7b9ca4a4579ea8e2c275f93 (patch)
treea1c6d6acd75903205983173ba97708e85d9ac0b8 /plugins/zsh-navigation-tools/n-cd
parent5b9c6c15e209ffdd07158dbf8ddf803d9710e850 (diff)
parente2d157d5895717e983e5cc4e5df792a6a5dbe0ac (diff)
downloadzsh-841d2b928704b4f8b7b9ca4a4579ea8e2c275f93.tar.gz
zsh-841d2b928704b4f8b7b9ca4a4579ea8e2c275f93.tar.bz2
zsh-841d2b928704b4f8b7b9ca4a4579ea8e2c275f93.zip
Merge pull request #5053 from psprint/master
znt: update to v2.1.15
Diffstat (limited to 'plugins/zsh-navigation-tools/n-cd')
-rw-r--r--plugins/zsh-navigation-tools/n-cd17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/zsh-navigation-tools/n-cd b/plugins/zsh-navigation-tools/n-cd
index b1ac5b159..48c6dbf4e 100644
--- a/plugins/zsh-navigation-tools/n-cd
+++ b/plugins/zsh-navigation-tools/n-cd
@@ -16,8 +16,8 @@ local IFS="
# Unset before configuration is read
unset NLIST_COLORING_PATTERN
-[ -f ~/.config/znt/n-list.conf ] && . ~/.config/znt/n-list.conf
-[ -f ~/.config/znt/n-cd.conf ] && . ~/.config/znt/n-cd.conf
+[ -f ~/.config/znt/n-list.conf ] && builtin source ~/.config/znt/n-list.conf
+[ -f ~/.config/znt/n-cd.conf ] && builtin source ~/.config/znt/n-cd.conf
local list
local selected
@@ -53,13 +53,16 @@ if [ "$REPLY" -gt 0 ]; then
(( NCD_DONT_PUSHD )) && setopt NO_AUTO_PUSHD
cd "$selected"
+ local code=$?
(( NCD_DONT_PUSHD )) && setopt AUTO_PUSHD
- # ZLE?
- if [ "${(t)CURSOR}" = "integer-local-special" ]; then
- zle -M "You have selected $selected"
- else
- echo "You have selected $selected"
+ if [ "$code" -eq "0" ]; then
+ # ZLE?
+ if [ "${(t)CURSOR}" = "integer-local-special" ]; then
+ zle -M "You have selected $selected"
+ else
+ echo "You have selected $selected"
+ fi
fi
else
[ "${(t)CURSOR}" = "integer-local-special" ] && zle redisplay