summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoichi Murase <myoga.murase@gmail.com>2024-03-10 16:32:25 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-03-10 21:41:42 +0900
commit01871ea38352993e3d150197d90b8be4bc907ce4 (patch)
tree724e934e88f3a74ff739a24f60de08944a52e6c5
parent1dbdb9438f67f490785e414f700158468cd5e871 (diff)
[bash] Update orig_complete after _completion_loader
-rw-r--r--shell/completion.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 00fb3f0a..dae8b210 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -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