Skip to content

Commit

Permalink
Don't read when KEYS_QUEUED_COUNT or PENDING
Browse files Browse the repository at this point in the history
Fixes issue #279.
  • Loading branch information
marlonrichert committed Jun 1, 2021
1 parent f21cf7f commit 112b791
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions module/.autocomplete.async
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ bindkey -s -M menuselect '^S' '^G^S'
}

.autocomplete.async.read-cursor-position() {
(( KEYS_QUEUED_COUNT || PENDING )) &&
return

[[ -v terminfo[u6] && -v terminfo[u7] ]] ||
return 0

Expand All @@ -71,13 +74,6 @@ bindkey -s -M menuselect '^S' '^G^S'

emulate -L zsh; setopt $_autocomplete__options

# Flush any pending input to the buffer.
if (( PENDING )); then
read -sk $PENDING -- LBUFFER
local nl=$'\n'
LBUFFER="${LBUFFER//$'\r'/$nl}"
fi

# Cursor position report (u6) always contains two %d markers.
local -a cpr=( "${(s:%d:)$( echoti u6 )}" )

Expand Down

0 comments on commit 112b791

Please sign in to comment.