fish: Don't append space after fzf completion

master
Pierre Neidhardt 2016-10-14 18:50:10 +05:30
parent 8e1bbc3e75
commit 7dae6cb3aa
1 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,8 @@ function __fzf-complete -d 'fzf completion and print selection back to commandli
set -l len (math (string length -- $cmd) - (string length -- $token))
commandline -- (string sub -l $len -- (commandline))
## Insert results.
for r in $result
for i in (seq (count $result))
set -l r $result[$i]
## We need to escape the result. We unescape 'r' first in case 'r' to
## prevent double escaping.
switch (string sub -s 1 -l 1 -- $token)
@ -46,7 +47,7 @@ function __fzf-complete -d 'fzf completion and print selection back to commandli
case '*'
commandline -i -- (string escape -n -- (eval "printf '%s' '$r'"))
end
commandline -i ' '
[ $i -lt (count $result) ]; and commandline -i ' '
end
commandline -f repaint