From 6532b3e655c765c79feaa5936d8e686d943c1e4e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 22 Aug 2022 22:29:51 +0900 Subject: [completion] Remove extra trailing slash on directory completion Fix #2931 --- shell/completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell/completion.bash') diff --git a/shell/completion.bash b/shell/completion.bash index 69b88165..c7d73818 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -181,7 +181,7 @@ __fzf_generic_path_completion() { [[ -z "$dir" ]] && dir='.' [[ "$dir" != "/" ]] && dir="${dir/%\//}" matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS $2" __fzf_comprun "$4" -q "$leftover" | while read -r item; do - printf "%q$3 " "$item" + printf "%q " "${item%$3}$3" done) matches=${matches% } [[ -z "$3" ]] && [[ "$__fzf_nospace_commands" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches " -- cgit v1.2.3