@@ -50,50 +50,6 @@ _zsh_highlight()
5050 return $ret
5151 }
5252
53- # Probe the memo= feature, once.
54- (( ${+zsh_highlight__memo_feature} )) || {
55- region_highlight+=( " 0 0 fg=red, memo=zsh-syntax-highlighting" )
56- case ${region_highlight[-1]} in
57- (" 0 0 fg=red" )
58- # zsh 5.8 or earlier
59- integer -gr zsh_highlight__memo_feature=0
60- ;;
61- (" 0 0 fg=red memo=zsh-syntax-highlighting" )
62- # zsh 5.9 or later
63- integer -gr zsh_highlight__memo_feature=1
64- ;;
65- (" 0 0 fg=red, memo=zsh-syntax-highlighting" ) ;&
66- (* )
67- # We can get here in two ways:
68- #
69- # 1. When not running as a widget. In that case, $region_highlight is
70- # not a special variable (= one with custom getter/setter functions
71- # written in C) but an ordinary one, so the third case pattern matches
72- # and we fall through to this block. (The test suite uses this codepath.)
73- #
74- # 2. When running under a future version of zsh that will have changed
75- # the serialization of $region_highlight elements from their underlying
76- # C structs, so that none of the previous case patterns will match.
77- #
78- # In either case, fall back to a version check.
79- #
80- # The memo= feature was added to zsh in commit zsh-5.8-172-gdd6e702ee.
81- # The version number at the time was 5.8.0.2-dev (see Config/version.mk).
82- # Therefore, on 5.8.0.3 and newer the memo= feature is available.
83- #
84- # On zsh version 5.8.0.2 between the aforementioned commit and the
85- # first Config/version.mk bump after it (which, at the time of writing,
86- # is yet to come), this condition will false negative.
87- if is-at-least 5.8.0.3 $ZSH_VERSION .0.0; then
88- integer -gr zsh_highlight__memo_feature=1
89- else
90- integer -gr zsh_highlight__memo_feature=0
91- fi
92- ;;
93- esac
94- region_highlight[-1]=()
95- }
96-
9753 # Reset region_highlight to build it from scratch
9854 if (( zsh_highlight__memo_feature )) ; then
9955 region_highlight=( " ${(@ )region_highlight:#* memo=zsh-syntax-highlighting* } " )
0 commit comments