fzf: Use only one unescaped "$cwd" in file-widget

master
Pierre Neidhardt 2016-11-29 17:15:09 +05:30
parent 0d9ce915ac
commit 3d9127ef30
1 changed files with 3 additions and 3 deletions

View File

@ -57,15 +57,15 @@ bind \cr __fzf-history-widget
## restrict search to this path.
## TODO: Report upstream. Makes '**' obsolete for bash and zsh.
function __fzf-file-widget
set -l cwd_esc (commandline -t)
set -l cwd (commandline -t)
## The commandline token might be escaped, we need to unescape it.
set -l cwd (eval "printf '%s' $cwd_esc")
set cwd (eval "printf '%s' $cwd")
if [ ! -d "$cwd" ]
set cwd .
end
set -q FZF_CTRL_T_COMMAND; or set -l FZF_CTRL_T_COMMAND "
command find -L $cwd_esc \\( -path $cwd_esc'*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \
command find -L \$cwd \\( -path \$cwd'*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 1d"