Fix multi-line history to correctly handle line breaks

This commit is contained in:
MamoruDS
2023-02-11 03:54:33 +09:00
parent de4c3c7a8a
commit 99211d7e40

View File

@@ -64,8 +64,7 @@ fzf_history_search() {
else else
BUFFER="${candidates[@]}" BUFFER="${candidates[@]}"
fi fi
BUFFER="${BUFFER[@]/(#b)(?)\\n/$match[1] BUFFER=$(printf "${BUFFER[@]//\\\\n/\\\\\\n}")
}"
zle vi-fetch-history -n $BUFFER zle vi-fetch-history -n $BUFFER
if [ -n "${ZSH_FZF_HISTORY_SEARCH_END_OF_LINE}" ]; then if [ -n "${ZSH_FZF_HISTORY_SEARCH_END_OF_LINE}" ]; then
zle end-of-line zle end-of-line