From d330b49b33bed50e295dee6850ac46136ff29372 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 6 Sep 2015 19:20:49 +0000 Subject: [PATCH] Fix variable leakage into global namespace. Similar to zsh-users/zsh-syntax-highlighting#97. --- highlighters/main/main-highlighter.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 540442c..d1d75de 100755 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -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]