From fd8d371ac790bfb72b904b52bf3f28974a4d8b74 Mon Sep 17 00:00:00 2001 From: Paul Frybarger Date: Fri, 5 Oct 2018 03:56:26 +0200 Subject: [zsh] Fix multiline prompt issue with 'zle reset-prompt' (#1397) Close #867 Close #1256 --- shell/completion.zsh | 9 +++------ shell/key-bindings.zsh | 7 ++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/shell/completion.zsh b/shell/completion.zsh index 4df21b33..f6052592 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -60,8 +60,7 @@ __fzf_generic_path_completion() { if [ -n "$matches" ]; then LBUFFER="$lbuf$matches$tail" fi - zle redisplay - typeset -f zle-line-init >/dev/null && zle zle-line-init + zle reset-prompt break fi dir=$(dirname "$dir") @@ -100,8 +99,7 @@ _fzf_complete() { if [ -n "$matches" ]; then LBUFFER="$lbuf$matches" fi - zle redisplay - typeset -f zle-line-init >/dev/null && zle zle-line-init + zle reset-prompt command rm -f "$fifo" } @@ -165,8 +163,7 @@ fzf-completion() { if [ -n "$matches" ]; then LBUFFER="$LBUFFER$matches" fi - zle redisplay - typeset -f zle-line-init >/dev/null && zle zle-line-init + zle reset-prompt # Trigger sequence given elif [ ${#tokens} -gt 1 -a "$tail" = "$trigger" ]; then d_cmds=(${=FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir}) diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index c25368cb..6aacc7e1 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -29,8 +29,7 @@ __fzfcmd() { fzf-file-widget() { LBUFFER="${LBUFFER}$(__fsel)" local ret=$? - zle redisplay - typeset -f zle-line-init >/dev/null && zle zle-line-init + zle reset-prompt return $ret } zle -N fzf-file-widget @@ -59,7 +58,6 @@ fzf-cd-widget() { cd "$dir" local ret=$? zle fzf-redraw-prompt - typeset -f zle-line-init >/dev/null && zle zle-line-init return $ret } zle -N fzf-cd-widget @@ -78,8 +76,7 @@ fzf-history-widget() { zle vi-fetch-history -n $num fi fi - zle redisplay - typeset -f zle-line-init >/dev/null && zle zle-line-init + zle reset-prompt return $ret } zle -N fzf-history-widget -- cgit v1.2.3