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 }