minor: Fix WARN_CREATE_GLOBAL warnings issued by zsh 5.1.1-dev-0.

The following warnings are issued by zsh as of zsh-workers/37018 (commit
de9effbce601 to zsh itself):

_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter match created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter mbegin created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter mend created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: numeric parameter parameter MBEGIN created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: numeric parameter parameter MEND created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: scalar parameter MATCH created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter match created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter mbegin created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter mend created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: numeric parameter parameter MBEGIN created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: numeric parameter parameter MEND created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: scalar parameter MATCH created globally in function _zsh_highlight_main_highlighter_highlight_string
This commit is contained in:
Daniel Shahaf 2015-10-30 07:09:46 +00:00
parent 8ab8c815ec
commit d3deffbf46
2 changed files with 5 additions and 0 deletions

View File

@ -389,6 +389,8 @@ _zsh_highlight_main_highlighter_check_path()
_zsh_highlight_main_highlighter_highlight_string()
{
setopt localoptions noksharrays
local -a match mbegin mend
local MATCH; integer MBEGIN MEND
local i j k style
# Starting quote is at 1, so start parsing at offset 2 in the string.
for (( i = 2 ; i < end_pos - start_pos ; i += 1 )) ; do
@ -423,6 +425,8 @@ _zsh_highlight_main_highlighter_highlight_string()
_zsh_highlight_main_highlighter_highlight_dollar_string()
{
setopt localoptions noksharrays
local -a match mbegin mend
local MATCH; integer MBEGIN MEND
local i j k style
local AA
integer c

View File

@ -52,6 +52,7 @@ _zsh_highlight_pattern_highlighter_loop()
# This does *not* do its job syntactically, sorry.
local buf="$1" pat="$2"
local -a match mbegin mend
local MATCH; integer MBEGIN MEND
if [[ "$buf" == (#b)(*)(${~pat})* ]]; then
region_highlight+=("$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_PATTERNS[$pat]")
"$0" "$match[1]" "$pat"; return $?