'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")
* upstream/pr/159:
Support literal newlines, part 2
Update comments. No functional change.
Highlight the first part of multiline strings correctly
Support literal newlines
Support backslash continuations
Support multiline strings
Refactoring, no functional change
Given the following input:
PREBUFFER=$'echo "foo\n'
BUFFER='bar"'
This patch causes the '"foo' part to be highlighted as a string. There
is no test because the tests only check highlighting of BUFFER, and 'bar"'
is already highlighted correctly.
`yank-pop` relies on the fact that the last zle command is `yank` or
`yank-pop` to work correctly. Rewriting them prevents this check to work
correctly breaking `yank-pop`.
This fix just disallow overriding of those two zle commands. As a
side-effect, syntax highlighting will not happen when using.
This fixes#99.
Edited links to Archlinux packages (the link to `zsh-syntax-highlighting-git` is out-of-date, and `zsh-syntax-highlighting` is now available in [community])
If one defines aliases like `++` the alias builtin tries to interprete these
as options so they have to be protected like this
alias -- ++=true
The same goes for a call to `alias` in order to expand the alias again.
This code is more lenient than bash. Examples:
$ x[y[]=
zsh: no matches found: x[y[]=
$ x[][]=
zsh: no matches found: x[][]=
The proper solution is to look inside the [...] and make sure that all
unescaped/unquoted square brackes are matched, but that is a heck of
a lot more complicated than this simple 8-character patch.
Zsh does not allow the variable name or the equals sign to be quoted or
escaped. The previous code incorrectly highlighted the following
examples as assignments:
$ 'x=y'
zsh: command not found: x=y
$ x\=y
zsh: command not found: x=y
$ "x"=y
zsh: command not found: x=y
$ \x=y
zsh: command not found: x=y