Skip to content
Myr

[completion] Remove extra trailing slash on directory completion

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #2931

authored by Junegunn Choi · committed by Junegunn Choi · parent c1c3551 · Browse files · 2 files+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−2 removed

  • other:+3 added−2 removed

2 files+3 added−2 removed

modified:shell/completion.bash+1 added-1 removed
179 unmodified lines
180 leftover=${leftover/#\/}181 [[ -z "$dir" ]] && dir='.'182 [[ "$dir" != "/" ]] && dir="${dir/%\//}"183 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; do184 printf "%q$3 " "$item"184 printf "%q " "${item%$3}$3"185 done)186 matches=${matches% }187 [[ -z "$3" ]] && [[ "$__fzf_nospace_commands" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches "188 if [[ -n "$matches" ]]; then
191 unmodified lines
modified:shell/completion.zsh+2 added-1 removed
144 unmodified lines
145 leftover=${leftover/#\/}146 [ -z "$dir" ] && dir='.'147 [ "$dir" != "/" ] && dir="${dir/%\//}"148 matches=$(eval "$compgen $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS" __fzf_comprun "$cmd" ${(Q)${(Z+n+)fzf_opts}} -q "$leftover" | while read item; do149 echo -n "${(q)item}$suffix "149 item="${item%$suffix}$suffix"150 echo -n "${(q)item} "151 done)152 matches=${matches% }153 if [ -n "$matches" ]; then154 LBUFFER="$lbuf$matches$tail"
170 unmodified lines