From da045d7f0784287b693efe3c9fdc326a9e44f120 Mon Sep 17 00:00:00 2001 From: wzy <32936898+Freed-Wu@users.noreply.github.com> Date: Thu, 5 Aug 2021 23:15:12 +0800 Subject: [PATCH] Fix #5 again --- zsh-fzf-history-search.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh-fzf-history-search.zsh b/zsh-fzf-history-search.zsh index d80292d..af97444 100644 --- a/zsh-fzf-history-search.zsh +++ b/zsh-fzf-history-search.zsh @@ -1,7 +1,9 @@ fzf_history_seach() { setopt extendedglob candidates=(${(f)"$(history -t '%Y-%m-%d %H:%M:%S' 0| fzf +s +m -x --tac -e -q "$BUFFER")"}) - print -v BUFFER "${candidates[@]/(#m)*/${${(As: :)MATCH}[4,-1]}}" + BUFFER="${candidates[@]/(#m)*/${${(As: :)MATCH}[4,-1]}}" + BUFFER="${BUFFER[@]/(#b)(?)\\n/$match[1] +}" zle end-of-buffer-or-history }