Refactored into a widget to enable asynchronous

update of the zle buffer
This commit is contained in:
Thiago de Arruda
2013-10-29 14:27:42 -03:00
parent 911730c1e4
commit 6d2146a542
3 changed files with 73 additions and 49 deletions

View File

@@ -33,13 +33,9 @@ autosuggest-server-connect() {
ZLE_AUTOSUGGEST_CONNECTION=$REPLY
}
autosuggest-first-completion() {
[[ -z $ZLE_AUTOSUGGEST_CONNECTION ]] && return 1
setopt local_options noglob
local response
print -u $ZLE_AUTOSUGGEST_CONNECTION - $1 &> /dev/null || return 1
while IFS= read -r -u $ZLE_AUTOSUGGEST_CONNECTION response; do
[[ $response == '' ]] && break
print - ${response}
done
}