Need to reset the POSTDISPLAY if exiting early

Specific case where this matters is following:

Be in vi insert mode with some text in the buffer and the cursor at the
end of the buffer. Press `esc` to trigger `vi-cmd-mode widget`, then
before the cursor moves (KEYTIMEOUT), press `h` to trigger
`vi-backward-char` widget. When `vi-cmd-mode` original widget exits,
KEYS_QUEUED_COUNT will be non-zero and the suggestion will be lost.
This commit is contained in:
Eric Freese
2018-05-15 11:32:46 -06:00
parent 51fef255da
commit 42f5a06f7f
3 changed files with 23 additions and 0 deletions

View File

@@ -333,6 +333,7 @@ _zsh_autosuggest_modify() {
# Don't fetch a new suggestion if there's more input to be read immediately
if (( $PENDING > 0 )) || (( $KEYS_QUEUED_COUNT > 0 )); then
POSTDISPLAY="$orig_postdisplay"
return $retval
fi