summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorJesus Briales <jesusbriales@gmail.com>2019-04-30 18:35:51 +0100
committerJunegunn Choi <junegunn.c@gmail.com>2019-05-01 02:35:51 +0900
commit03e8ed4d8813684b1a3dd0831f0eab63b44e1499 (patch)
treebc7d9dfa00912fd4f0958f5a34b513c6f7270a5d /shell
parentef492f6178ba0349e93d8180006b41bc1dc0afc1 (diff)
downloadfzf-03e8ed4d8813684b1a3dd0831f0eab63b44e1499.tar.gz
[bash-completion] Fix custom completion with dynamic loader enabled for non-standard command names (#1564)
Related to #1170. Fix the solution for commands with non-standard names where `$cmd` and `$orig_cmd` differ. e.g. `s.foo` -> `s_foo`
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 15d2f952..29648297 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -123,11 +123,11 @@ _fzf_handle_dynamic_completion() {
if [ -n "$orig" ] && type "$orig" > /dev/null 2>&1; then
$orig "$@"
elif [ -n "$_fzf_completion_loader" ]; then
- orig_complete=$(complete -p "$cmd" 2> /dev/null)
+ orig_complete=$(complete -p "$orig_cmd" 2> /dev/null)
_completion_loader "$@"
ret=$?
# _completion_loader may not have updated completion for the command
- if [ "$(complete -p "$cmd" 2> /dev/null)" != "$orig_complete" ]; then
+ if [ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]; then
eval "$(complete | command grep " -F.* $orig_cmd$" | __fzf_orig_completion_filter)"
if [[ "$__fzf_nospace_commands" = *" $orig_cmd "* ]]; then
eval "${orig_complete/ -F / -o nospace -F }"