mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2026-05-01 00:40:38 +02:00
main: Move pending-input check before region_highlight reset
This commit is contained in:
parent
1d85c69261
commit
ccdd394e3f
1 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue