From 99211d7e405ea5bb261fc2e0b1068eec7092757c Mon Sep 17 00:00:00 2001 From: MamoruDS Date: Sat, 11 Feb 2023 03:54:33 +0900 Subject: [PATCH] Fix multi-line history to correctly handle line breaks --- zsh-fzf-history-search.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zsh-fzf-history-search.zsh b/zsh-fzf-history-search.zsh index 9dde3cc..7eaf9fd 100644 --- a/zsh-fzf-history-search.zsh +++ b/zsh-fzf-history-search.zsh @@ -64,8 +64,7 @@ fzf_history_search() { else BUFFER="${candidates[@]}" fi - BUFFER="${BUFFER[@]/(#b)(?)\\n/$match[1] -}" + BUFFER=$(printf "${BUFFER[@]//\\\\n/\\\\\\n}") zle vi-fetch-history -n $BUFFER if [ -n "${ZSH_FZF_HISTORY_SEARCH_END_OF_LINE}" ]; then zle end-of-line