mirror of
https://github.com/junegunn/fzf
synced 2024-11-01 03:20:42 +00:00
[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: ef2c29d5d4
("[bash-completion] Optimize __fzf_orig_completion_filter")
This commit is contained in:
parent
75b8cca3b3
commit
7bd99a22ee
@ -53,6 +53,7 @@ __fzf_orig_completion() {
|
|||||||
comp="${BASH_REMATCH[1]}"
|
comp="${BASH_REMATCH[1]}"
|
||||||
f="${BASH_REMATCH[2]}"
|
f="${BASH_REMATCH[2]}"
|
||||||
cmd="${BASH_REMATCH[3]}"
|
cmd="${BASH_REMATCH[3]}"
|
||||||
|
[[ "$f" = _fzf_* ]] && continue
|
||||||
printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}"
|
printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}"
|
||||||
if [[ "$l" = *" -o nospace "* ]] && [[ ! "$__fzf_nospace_commands" = *" $cmd "* ]]; then
|
if [[ "$l" = *" -o nospace "* ]] && [[ ! "$__fzf_nospace_commands" = *" $cmd "* ]]; then
|
||||||
__fzf_nospace_commands="$__fzf_nospace_commands $cmd "
|
__fzf_nospace_commands="$__fzf_nospace_commands $cmd "
|
||||||
|
Loading…
Reference in New Issue
Block a user