This commit is contained in:
Richard Osborn 2026-03-28 17:03:19 -05:00 committed by GitHub
commit 485d330a7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,6 +165,11 @@ _zsh_highlight()
region_highlight[-1]=() region_highlight[-1]=()
} }
# Do not highlight if there are pending inputs (copy/paste).
# Placed before the region_highlight reset to preserve existing highlights.
(( KEYS_QUEUED_COUNT > 0 )) && return $ret
(( PENDING > 0 )) && return $ret
# Reset region_highlight to build it from scratch # Reset region_highlight to build it from scratch
if (( zsh_highlight__memo_feature )); then if (( zsh_highlight__memo_feature )); then
region_highlight=( "${(@)region_highlight:#*memo=zsh-syntax-highlighting*}" ) region_highlight=( "${(@)region_highlight:#*memo=zsh-syntax-highlighting*}" )
@ -210,10 +215,6 @@ _zsh_highlight()
# likely a pasted command or a huge list of files in that case.. # likely a pasted command or a huge list of files in that case..
[[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret [[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret
# Do not highlight if there are pending inputs (copy/paste).
(( KEYS_QUEUED_COUNT > 0 )) && return $ret
(( PENDING > 0 )) && return $ret
{ {
local cache_place local cache_place
local -a region_highlight_copy local -a region_highlight_copy