This commit is contained in:
2021-11-15 00:26:15 +04:00
parent 8583c61d95
commit 081dc5ccc1
10 changed files with 64 additions and 17 deletions

View File

@@ -2,14 +2,14 @@ function __fzf_parse_commandline -d 'Parse the current command line token and re
# eval is used to do shell expansion on paths
set -l commandline (eval "printf '%s' "(commandline -t))
if [ -z $commandline ]
if test -z $commandline
# Default to current directory with no --query
set dir '.'
set fzf_query ''
else
set dir (__fzf_get_dir $commandline)
if [ "$dir" = "." -a (string sub -l 1 $commandline) != '.' ]
if test "$dir" = "." -a (string sub -l 1 $commandline) != '.'
# if $dir is "." but commandline is not a relative path, this means no file path found
set fzf_query $commandline
else