From c7caf57ca805abd54f11f756fda6395dd4187f8a 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