Skip to content

Commit

Permalink
Fix problem where alternative async completion modes would return 0 r…
Browse files Browse the repository at this point in the history
…esults
  • Loading branch information
marlonrichert committed Jun 5, 2024
1 parent 710752f commit 5624f7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Functions/Init/.autocomplete__async
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ ${0}:precmd() {
return 0
}

# function -T
.autocomplete:async:start() {
local fd=
sysopen -r -o cloexec -u fd <(
Expand All @@ -216,6 +217,7 @@ ${0}:precmd() {
command true
}

# function -T
.autocomplete:async:start:inner() {
{
typeset -F SECONDS=0
Expand Down Expand Up @@ -271,6 +273,7 @@ ${0}:precmd() {
}
}

# function -T
.autocomplete:async:pty() {
# Make sure this shell dies after it times out.
local -F seconds=
Expand All @@ -290,6 +293,7 @@ ${0}:precmd() {
:
}

# function -T
.autocomplete:async:pty:zle-widget() {
local -a _autocomplete__comp_mesg=()
local -i _autocomplete__list_lines=0
Expand All @@ -312,6 +316,7 @@ ${0}:precmd() {
}
} 2>>| $_autocomplete__log

# function -T
.autocomplete:async:pty:completion-widget() {
{
if ! .autocomplete:async:sufficient-input; then
Expand All @@ -320,7 +325,7 @@ ${0}:precmd() {
{
unfunction compadd 2> /dev/null
unset 'compstate[vared]'
autocomplete:_main_complete:new
.autocomplete:async:list-choices:main-complete
} always {
_autocomplete__list_lines=$compstate[list_lines]
}
Expand Down

0 comments on commit 5624f7b

Please sign in to comment.