[bash] Fix infinite retry loop for completion setting without "-F func" (#4004)

This commit is contained in:
Koichi Murase 2024-09-23 19:16:59 +09:00 committed by GitHub
parent 855f90727a
commit 30a8ef28cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -264,6 +264,7 @@ _fzf_handle_dynamic_completion() {
# _completion_loader may not have updated completion for the command
if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then
__fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)
__fzf_orig_completion_get_orig_func "$cmd" || ret=1
# Update orig_complete by _fzf_orig_completion entry
[[ $orig_complete =~ ' -F '(_fzf_[^ ]+)' ' ]] &&