Daniel Shahaf
c2b9327b07
Support literal newlines, part 2
пре 9 година
Daniel Shahaf
52ece975c3
Update comments. No functional change.
пре 9 година
Daniel Shahaf
359d48bf78
Don't highlight prefix redirections as error
Fixes zsh-users/zsh-syntax-highlighting#146
пре 9 година
Daniel Shahaf
ff4d402e9a
Highlight the first part of multiline strings correctly
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.
пре 9 година
Daniel Shahaf
384be15b13
Support literal newlines
пре 9 година
Daniel Shahaf
23cacb12fe
Support backslash continuations
пре 9 година
Daniel Shahaf
667495bfb7
Support multiline strings
пре 9 година
Daniel Shahaf
2c5acaefa9
Refactoring, no functional change
The new function will be used in the next commit.
пре 9 година
Joost Cassee
d7d4dff1c8
Add 'line' highlighter for the whole buffer
пре 10 година
Randy
e8cc271314
Resolves slow performance in brackets highlighter
пре 10 година
sonnym
04f9c8884f
highlight ^old^new pattern
by extending the already in place mechanism of checking for the first
histchar to check for the second as well
пре 10 година
Lucas Hoffmann
784a5dc35b
protect alias expansion from interpreting aliases as options
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.
пре 11 година
Mark Lodato
441f1a8aad
highlight array assignments of the form x[y]=...
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.
пре 11 година
Mark Lodato
c62cb54e9d
do not remove quotes when checking assignments
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
пре 11 година
Akinori MUSHA
0fc6b07509
Do not leak a variable: cdpath_dir.
Leaking a variable that holds a path in CDPATH could easily end up appearing on your prompt like `~cdpath_dir/subdir`.
пре 11 година
Antoine Catton
3b3a58be91
Fix #121 : sudo syntax highlighting incorrectly
Parse sudo command line in order to highlight the options correctly
пре 11 година
Julien Nicoulaud
dbd27cb30a
#155 : document path_prefix/path_approx
пре 11 година
Shura
a7ee0597ef
Update main-highlighter.zsh
Comments added
пре 11 година
Владимир
57c01d19de
Update main-highlighter.zsh
Add support of CDPATH
пре 11 година
Shura
8abcf187f6
dollar variable and backslash codes highlighting
пре 11 година
James Kyle
93827ed84d
Issue #92 Eliminates system bell errors on osx.
Prepended an 'if' to remove error bell on osx systems.
пре 11 година
Vincent Breitmoser
228f5a6aad
add separate path_prefix and path_approx hilights
пре 11 година
Chris Knadler
612e493cba
Fix relative links in highlighters readme
пре 11 година
Takeshi Banse
b4e667795c
make $pattern local to _zsh_highlight_pattern_highlighter #97
Signed-off-by: Takeshi Banse <takebi@laafc.net>
пре 11 година
evan
19981ef9ea
added sudo as a precommand
пре 12 година
Jan M. Binder
732b7d6e65
Fix bracket highlighter
пре 12 година
Jud Porter
d82eee5212
add emulate -L zsh to _zsh_highlight_main_highlighter. resolves issue #83
пре 12 година
Julien Nicoulaud
f824e5e84d
Options should only be set locally
пре 13 година
Andreas Gahr
024c1c46f7
next try. fix for issue #76 without brakeing fix for #21
пре 13 година
Julien Nicoulaud
8d4cde6301
(Hopefully) fix #21 (tilde and hashed directories in paths)
пре 13 година
Julien Nicoulaud
db8f98fc53
Set default style for pipes and stuff to none
пре 13 година
Andreas Gahr
287167d453
fix for issue #76 . This was more ore less forgotten in pull request #75
пре 13 година
Andreas Gahr
670961ad01
handle highlighting for precommands; handle highlighting for commands separators
пре 13 година
Andreas Gahr
f84f9319d8
supposed fix for issue #73 and issue #74
пре 13 година
Julien Nicoulaud
a6d105131c
Fix #21 : No highlighting when using tilde
пре 13 година
Takeshi Banse
1d729202ec
add tests for handling tildes
Signed-off-by: Takeshi Banse <takebi@laafc.net>
пре 13 година
Takeshi Banse
48a18291f9
add some tests
Signed-off-by: Takeshi Banse <takebi@laafc.net>
пре 13 година
Takeshi Banse
4a8b184632
pass ${arg} explicit
Signed-off-by: Takeshi Banse <takebi@laafc.net>
пре 13 година
Andreas Gahr
b1b65dc486
bracket highlighter: small typo in testcase - document new style
пре 13 година
Andreas Gahr
06ad03e32c
bracket highlighter: simplify
пре 13 година
Andreas Gahr
8375ef6e72
bracket highlighter: make the style configurable, when cursor is on bracket
пре 13 година
Andreas Gahr
24243becba
bracket highlighter: fix typo from last commit
пре 13 година
Andreas Gahr
e1ed255c0a
bracket highlighter: start loops with 0 which is more natural and also more in line whith the other highlighters
пре 13 година
Andreas Gahr
0d55207c78
simple testcases for bracket highlighter - actually add files
пре 13 година
Andreas Gahr
33813c6a52
simple testcases for bracket highlighter
пре 13 година
Valodim
f27ef7a279
after exec token we can expect a command
пре 13 година
Julien Nicoulaud
08dae96eb1
Add highlighter triggered when the user is root
пре 13 година
Julien Nicoulaud
11de634b33
Add cursor highlighter
пре 13 година
garinger
e7ab165310
* optimize discrimination of bracket-type
* use a nicer variable name
пре 13 година
garinger
f1eb5aeef7
skip all brackets inside quotes (" and ')
пре 13 година