Compare commits

...

3 Commits

Author SHA1 Message Date
Richard Osborn 495a746c56
Merge ccdd394e3f into 2fc57d6306 2026-08-22 09:20:15 +07:00
Manish Tiwari 2fc57d6306 tests: fix relative links in tests/README.md
test-highlighting.zsh and test-perfs.zsh were linked as tests/test-*.zsh,
but this file already lives in tests/, so the links resolved to
tests/tests/test-*.zsh and 404'd. Found by pointing a markdown
link-checker at the repo.
2026-08-21 21:19:05 -05:00
Richard Osborn ccdd394e3f
main: Move pending-input check before region_highlight reset 2026-03-28 16:51:28 -05:00
2 changed files with 7 additions and 6 deletions

View File

@ -86,7 +86,7 @@ grow ways to set `$PREBUFFER` to inject free-form code into the generated file.
Highlighting test Highlighting test
----------------- -----------------
[`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of [`test-highlighting.zsh`](test-highlighting.zsh) tests the correctness of
the highlighting. Usage: the highlighting. Usage:
```zsh ```zsh
@ -110,7 +110,7 @@ results (tests that failed but were expected to succeed, or vice-versa), run
Performance test Performance test
---------------- ----------------
[`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the [`test-perfs.zsh`](test-perfs.zsh) measures the time spent doing the
highlighting. Usage: highlighting. Usage:
```zsh ```zsh

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