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