Skip to content

Commit b2f3d36

Browse files
committed
tweak completion to be more responsive when no match is found
1 parent a7c01c9 commit b2f3d36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

env/redo_completion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ __redo_completion () {
9191

9292
compgen_res=$(compgen -W "$compgen_arg" "$this_word")
9393

94-
# if nothing in cache matches, do synchronous anyway
95-
if [ -z "$compgen_res" ]; then
94+
# if nothing in cache matches, do synchronous anyway (but only on first run to make it responsive)
95+
if [ "$first_run" = true ] && [ -z "$compgen_res" ]; then
9696
do_synch=true
9797
elif ! ps p "$__redo_what_bg_pid" >/dev/null 2>&1; then
9898
# pid is not alive, so start bg process

0 commit comments

Comments
 (0)