Merge pull request #7 from Freed-Wu/Freed-Wu-patch-1

Fix #5 again
This commit is contained in:
Josh Skidmore 2021-08-05 12:43:22 -04:00 committed by GitHub
commit 54f8015e01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}