Skip to content

Commit

Permalink
[bash] Update orig_complete after _completion_loader
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga authored and junegunn committed Mar 10, 2024
1 parent 1dbdb94 commit 01871ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shell/completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ _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)

# Update orig_complete by _fzf_orig_completion entry
[[ $orig_complete =~ ' -F '(_fzf_[^ ]+)' ' ]] &&
__fzf_orig_completion_instantiate "$cmd" "${BASH_REMATCH[1]}" &&
orig_complete=$REPLY

if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then
eval "${orig_complete/ -F / -o nospace -F }"
else
Expand Down

0 comments on commit 01871ea

Please sign in to comment.