Skip to content

Commit 075c852

Browse files
committed
driver: Stop re-declaring $region_highlight. It's unneeded.
1 parent fb929ed commit 075c852

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

zsh-syntax-highlighting.zsh

+7-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ _zsh_highlight()
7676
# Make it read-only. Can't combine this with the previous line when POSIX_BUILTINS may be set.
7777
typeset -r ret
7878

79+
# $region_highlight should be predefined, either by zle or by the test suite's mock (non-special) array.
80+
(( ${+region_highlight} )) || {
81+
echo >&2 'zsh-syntax-highlighting: error: $region_highlight is not defined'
82+
echo >&2 'zsh-syntax-highlighting: (Check whether zsh-syntax-highlighting was installed according to the instructions.)'
83+
return $ret
84+
}
85+
7986
# Remove all highlighting in isearch, so that only the underlining done by zsh itself remains.
8087
# For details see FAQ entry 'Why does syntax highlighting not work while searching history?'.
8188
# This disables highlighting during isearch (for reasons explained in README.md) unless zsh is new enough
@@ -118,7 +125,6 @@ _zsh_highlight()
118125
[[ $PENDING -gt 0 ]] && return $ret
119126

120127
# Reset region highlight to build it from scratch
121-
typeset -ga region_highlight
122128
region_highlight=();
123129

124130
{

0 commit comments

Comments
 (0)