From a0b5bc6c71a80b97a0826c7b2fc30eec7e80b442 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 7 Sep 2015 01:26:11 +0000 Subject: [PATCH] Fix bug in previous commit (d330b49b33bed50e295dee6850ac46136ff29372) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'local' is a reserved word in zsh 5.1 but not in earlier versions [1]. Therefore, under zsh older than 5.1, quoting is required. This manifested as random «builtin=''» in emitted to the terminal, and commands (such as 'echo') highlighted as errors (in red). [1] https://github.com/zsh-users/zsh/blob/master/README#L46 (the section "Incompatibilites between 5.0.8 and 5.1") --- 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 d1d75de..0841989 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 - local 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]