diff options
author | Tomas Janousek <tomi@nomi.cz> | 2020-11-13 15:59:29 +0000 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-11-14 10:29:05 +0900 |
commit | 7bd99a22eeba74c88ad60f860111247a052f5586 (patch) | |
tree | e29fb48cac38cce12533c2ae24c56f6ea72079ec /shell | |
parent | 75b8cca3b3d0663ea4102f08c763cf2b0b999f88 (diff) |
[bash-completion] Fix endless loop when completion.bash sourced twice
I forgot to add the "not _fzf" check into __fzf_orig_completion, so
invoking it twice would rewrite the _fzf_orig_completion_xxx variables
and then cause an endless loop when completion is requested.
Fixes: ef2c29d5d497 ("[bash-completion] Optimize __fzf_orig_completion_filter")
Diffstat (limited to 'shell')
-rw-r--r-- | shell/completion.bash | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/shell/completion.bash b/shell/completion.bash index 12baaf05..1eefd099 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -53,6 +53,7 @@ __fzf_orig_completion() { comp="${BASH_REMATCH[1]}" f="${BASH_REMATCH[2]}" cmd="${BASH_REMATCH[3]}" + [[ "$f" = _fzf_* ]] && continue printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}" if [[ "$l" = *" -o nospace "* ]] && [[ ! "$__fzf_nospace_commands" = *" $cmd "* ]]; then __fzf_nospace_commands="$__fzf_nospace_commands $cmd " |