From 3944a44ffe447b64d4bc55a1ff66154363bb0dd6 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 10 Aug 2020 07:36:40 +0000 Subject: [PATCH] driver: Fix a version number check to work around a bug in the zsh version whereunder the check should return false. The bug is as follows: % zsh-5.8 -fc 'autoload is-at-least; is-at-least 5.8.0.2 && echo yes || echo no' yes % zsh-5.8 -fc 'autoload is-at-least; is-at-least 5.8.0.2 $ZSH_VERSION && echo yes || echo no' yes This commit deploys the following workaround: % zsh-5.8 -fc 'autoload is-at-least; is-at-least 5.8.0.2 $ZSH_VERSION.0.0 && echo yes || echo no' no Fixes #756. --- zsh-syntax-highlighting.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 3608203..d20dc5b 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -163,7 +163,7 @@ _zsh_highlight() # On zsh version 5.8.0.2 between the aforementioned commit and the # first Config/version.mk bump after it (which, at the time of writing, # is yet to come), this condition will false negative. - if is-at-least 5.8.0.3; then + if is-at-least 5.8.0.3 $ZSH_VERSION.0.0; then integer -gr zsh_highlight__memo_feature=1 else integer -gr zsh_highlight__memo_feature=0 @@ -414,7 +414,7 @@ _zsh_highlight_call_widget() # # See _zsh_highlight for the magic version number. (The use of 5.8.0.2 # rather than 5.8.0.3 as in the _zsh_highlight is deliberate.) -if is-at-least 5.8.0.2 && _zsh_highlight__function_callable_p add-zle-hook-widget +if is-at-least 5.8.0.2 $ZSH_VERSION.0.0 && _zsh_highlight__function_callable_p add-zle-hook-widget then autoload -U add-zle-hook-widget _zsh_highlight__zle-line-finish() {