Skip to content

Commit cb33cc0

Browse files
committed
On the feature/redrawhook branch, change the detection of the 'memo=' feature to avoid a catch-22.
1 parent 9ce3540 commit cb33cc0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

zsh-syntax-highlighting.zsh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,14 @@ _zsh_highlight_call_widget()
407407
#
408408
# 2. If zsh has the memo= feature, which is required for interoperability reasons.
409409
# See issues #579 and #735, and the issues referenced from them.
410-
if (( zsh_highlight__memo_feature )) && _zsh_highlight__function_callable_p add-zle-hook-widget
410+
#
411+
# We check this with a plain version number check, since a functional check,
412+
# as done by _zsh_highlight, can only be done from inside a widget
413+
# function — a catch-22.
414+
#
415+
# See _zsh_highlight for the magic version number. (The use of 5.8.0.2
416+
# rather than 5.8.0.3 as in the _zsh_highlight is deliberate.)
417+
if is-at-least 5.8.0.2 && _zsh_highlight__function_callable_p add-zle-hook-widget
411418
then
412419
autoload -U add-zle-hook-widget
413420
_zsh_highlight__zle-line-finish() {

0 commit comments

Comments
 (0)