Fix variable leakage into global namespace.

Similar to zsh-users/zsh-syntax-highlighting#97.
This commit is contained in:
Daniel Shahaf 2015-09-06 19:20:49 +00:00
parent f78919d941
commit d330b49b33

View File

@ -147,7 +147,7 @@ _zsh_highlight_main_highlighter()
style=$ZSH_HIGHLIGHT_STYLES[precommand]
sudo=true
else
res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
local res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
case $res in
*': reserved') style=$ZSH_HIGHLIGHT_STYLES[reserved-word];;
*': alias') style=$ZSH_HIGHLIGHT_STYLES[alias]