From a13d2621f31044e95e85e89a9e82d744ceedaf15 Mon Sep 17 00:00:00 2001 From: Kid Date: Wed, 12 May 2021 16:06:02 +0800 Subject: [PATCH] [Search files] fix preview for paths containing spaces (final) --- functions/__fzf_preview_file.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/__fzf_preview_file.fish b/functions/__fzf_preview_file.fish index 03adfea7..440d6bb1 100644 --- a/functions/__fzf_preview_file.fish +++ b/functions/__fzf_preview_file.fish @@ -16,14 +16,14 @@ function __fzf_preview_file --description "Print a preview for the given file ba else if test -f "$file_path" # regular file if set --query fzf_preview_file_cmd # need to escape quotes to make sure eval receives file_path as a single arg - eval $fzf_preview_file_cmd \"$file_path\" + eval "$fzf_preview_file_cmd '$file_path'" else bat --style=numbers --color=always "$file_path" end else if test -d "$file_path" # directory if set --query fzf_preview_dir_cmd # see above - eval $fzf_preview_dir_cmd \"$file_path\" + eval "$fzf_preview_dir_cmd '$file_path'" else # -A list hidden files as well, except for . and .. # -F helps classify files by appending symbols after the file name