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