From 7dae6cb3aaf465840fd3bbc54dbddaffdac47050 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 14 Oct 2016 18:50:10 +0530 Subject: [PATCH] fish: Don't append space after fzf completion --- .config/fish/fzf.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/fish/fzf.fish b/.config/fish/fzf.fish index cf492659..3f78f3be 100644 --- a/.config/fish/fzf.fish +++ b/.config/fish/fzf.fish @@ -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