Skip to content
Myr

[bash-completion] Fix custom completion with dynamic loader enabled for non-standard command names (#1564)

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

Related to #1170. Fix the solution for commands with non-standard names where `$cmd` and `$orig_cmd` differ. e.g. `s.foo` -> `s_foo`

authored by Jesus Briales · committed by Junegunn Choi · parent ef492f6 · Browse files · 1 file+2 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

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:shell/completion.bash+2 added-2 removed
121 unmodified lines
122 orig="${!orig_var##*#}"123 if [ -n "$orig" ] && type "$orig" > /dev/null 2>&1; then124 $orig "$@"125 elif [ -n "$_fzf_completion_loader" ]; then126 orig_complete=$(complete -p "$cmd" 2> /dev/null)126 orig_complete=$(complete -p "$orig_cmd" 2> /dev/null)127 _completion_loader "$@"128 ret=$?129 # _completion_loader may not have updated completion for the command130 if [ "$(complete -p "$cmd" 2> /dev/null)" != "$orig_complete" ]; then130 if [ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]; then131 eval "$(complete | command grep " -F.* $orig_cmd$" | __fzf_orig_completion_filter)"132 if [[ "$__fzf_nospace_commands" = *" $orig_cmd "* ]]; then133 eval "${orig_complete/ -F / -o nospace -F }"134 else
202 unmodified lines