File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -293,8 +293,19 @@ fzf-tab-complete() {
293293 local IN_FZF_TAB=1
294294 {
295295 zle .fzf-tab-orig-$_ftb_orig_widget || ret=$?
296- if (( ! ret && ! _ftb_finish )) ; then
297- zle _fzf-tab-apply || ret=$?
296+ # The original completion widget (expand-or-complete or its wrappers)
297+ # can return non-zero for ambiguous/list-only completions; apply choices
298+ # when present, and clear list state on successful no-choice runs.
299+ if (( ! _ftb_finish )) ; then
300+ if (( $# _ftb_choices )) ; then
301+ zle _fzf-tab-apply || ret=$?
302+ elif (( ! ret )) ; then
303+ # compstate is only defined when compsys runs; glob expansion bypasses it.
304+ if (( $+ compstate )) ; then
305+ compstate[list]=
306+ compstate[insert]=
307+ fi
308+ fi
298309 fi
299310 } always {
300311 IN_FZF_TAB=0
You can’t perform that action at this time.
0 commit comments