Преглед на файлове

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 години
родител
ревизия
a0b5bc6c71
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. +1
    -1
      highlighters/main/main-highlighter.zsh

+ 1
- 1
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]

Зареждане…
Отказ
Запис