[fish] Don't strip leading dot (.) character

Fix the removal of the leading dot character from the query, when
<Ctrl-T> was pressed and the current command line token started with a
dot. It was also removed when <Alt-C> was pressed and the directory
didn't exist under the current path.
This commit is contained in:
bitraid 2024-12-19 10:31:52 +02:00 committed by Junegunn Choi
parent 0476a65fca
commit 7bd298b536

View File

@ -172,7 +172,7 @@ function fzf_key_bindings
# BUG: on combined expressions, if a left argument is a single `!`, the
# builtin test command of fish will treat it as the ! operator. To
# overcome this, have the variable parts on the right.
if test "." = "$dir" -a "." != (string sub -l 1 -- $commandline)
if test "." = "$dir" -a "./" != (string sub -l 2 -- $commandline)
# if $dir is "." but commandline is not a relative path, this means no file path found
set fzf_query $commandline
else