From 1913518b62b98dc047d44ff1282d53986bf9a717 Mon Sep 17 00:00:00 2001 From: Daniel Kuettel Date: Sat, 25 Sep 2021 11:21:23 +0200 Subject: [PATCH] check KEYS_QUEUED_COUNT and PENDING to skip parsing when pasting --- zsh-syntax-highlighting.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index d20dc5b..14f6e1f 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -219,7 +219,8 @@ _zsh_highlight() [[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret # Do not highlight if there are pending inputs (copy/paste). - [[ $PENDING -gt 0 ]] && return $ret + (( KEYS_QUEUED_COUNT > 0 )) && return $ret + (( PENDING > 0 )) && return $ret { local cache_place