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.
This commit is contained in:
Daniel Shahaf 2020-08-10 07:36:40 +00:00
parent 34674d7860
commit 3944a44ffe
1 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ _zsh_highlight()
# On zsh version 5.8.0.2 between the aforementioned commit and the # 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, # first Config/version.mk bump after it (which, at the time of writing,
# is yet to come), this condition will false negative. # 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 integer -gr zsh_highlight__memo_feature=1
else else
integer -gr zsh_highlight__memo_feature=0 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 # 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.) # 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 then
autoload -U add-zle-hook-widget autoload -U add-zle-hook-widget
_zsh_highlight__zle-line-finish() { _zsh_highlight__zle-line-finish() {