Put in a general fix for #219 - Handling input from zle -U
Depends on patch to ZSH from workers/40702: http://www.zsh.org/mla/workers/2017/msg00414.html
This commit is contained in:
@@ -293,6 +293,9 @@ _zsh_autosuggest_clear() {
|
||||
_zsh_autosuggest_modify() {
|
||||
local -i retval
|
||||
|
||||
# Only added to zsh very recently
|
||||
local -i KEYS_QUEUED_COUNT
|
||||
|
||||
# Save the contents of the buffer/postdisplay
|
||||
local orig_buffer="$BUFFER"
|
||||
local orig_postdisplay="$POSTDISPLAY"
|
||||
@@ -304,6 +307,11 @@ _zsh_autosuggest_modify() {
|
||||
_zsh_autosuggest_invoke_original_widget $@
|
||||
retval=$?
|
||||
|
||||
# Don't fetch a new suggestion if there's more input to be read immediately
|
||||
if [[ $PENDING > 0 ]] || [[ $KEYS_QUEUED_COUNT > 0 ]]; then
|
||||
return $retval
|
||||
fi
|
||||
|
||||
# Optimize if manually typing in the suggestion
|
||||
if [ $#BUFFER -gt $#orig_buffer ]; then
|
||||
local added=${BUFFER#$orig_buffer}
|
||||
|
||||
Reference in New Issue
Block a user