summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/key-bindings.zsh11
1 files changed, 8 insertions, 3 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index 2433d988..63306142 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -87,10 +87,15 @@ fzf-cd-widget() {
zle redisplay
return 0
fi
- BUFFER="cd ${(q)dir}"
- unset dir # ensure this doesn't end up appearing in prompt expansion
- zle accept-line
+ if [ -z "$BUFFER" ]; then
+ BUFFER="cd ${(q)dir}"
+ zle accept-line
+ else
+ print -sr "cd ${(q)dir}"
+ cd "$dir"
+ fi
local ret=$?
+ unset dir # ensure this doesn't end up appearing in prompt expansion
zle fzf-redraw-prompt
return $ret
}