Browse Source

Fix bug in previous commit (d330b49b33)

'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")
pull/190/head
Daniel Shahaf 9 years ago
parent
commit
a0b5bc6c71
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      highlighters/main/main-highlighter.zsh

+ 1
- 1
highlighters/main/main-highlighter.zsh View File

@ -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]

Loading…
Cancel
Save