Daniel Shahaf
73cb832702
'main': Highlight mismatched 'if'/'fi'.
Also 'then'/'elif'/'else'.
7 years ago
Daniel Shahaf
237f89ad62
'main': Don't consider «$*» a glob.
7 years ago
Daniel Shahaf
9523d6d49c
tests: zsh 5.4-to-be compatibility: Set a new "I am shooting myself in the foot" option.
7 years ago
Daniel Shahaf
76ea9e1df3
'main': Highlight possible history expansions in double-quoted strings.
7 years ago
Daniel Shahaf
347cf0eb06
'main': Add regression test for previous commit.
8 years ago
Sebastian Gniazdowski
5625e30b87
'main': Fix bug: no start_pos=$end_pos in comment short path
8 years ago
Daniel Shahaf
fed37a90ac
'main': Fix a bug concerning command word with embedded colon-space sequences.
Such a command word would, if not valid, fall through to the `type -w` case,
where the output would be misparsed, consequently the forward-compatible [arg0]
style would be used.
8 years ago
Daniel Shahaf
035d3eb095
Follow-up to 28d7056a7a06: Fix test expectations.
8 years ago
Daniel Shahaf
28d7056a7a
'main': Escape '!' within double-quoted strings.
8 years ago
Daniel Shahaf
7d38d07255
'main': Followup to fdaeec45146b: Update comment.
That revision was itself a followup to 51614ca2c9
.
8 years ago
Daniel Shahaf
bccc3dc269
'main': Enable fallback to the 'arg0' style.
8 years ago
Daniel Shahaf
b4537a972e
'main': Set fallback style for the 'arg0' style.
The fallback style name uses '_' in anticipation of a future auto-fallback
feature keyed on style names.
'arg0' was previously known as 'commandtypefromthefuture'.
8 years ago
Daniel Shahaf
79198759b3
tests: Also test arguments to an anonymous function.
8 years ago
Sebastian Gniazdowski
15461e7d21
'main': Directly count spaces to skip, don't leverage proc_buf length
Main highlighter run on itself, on the optimized version:
- optimized (8 runs, 3 last noted):
1.1201650000
1.1074430000
1.1263810000
- unoptimized (8 runs, 3 last noted):
1.5746400000
1.5115250000
1.5155440000
Average difference: 0.415907
8 years ago
Daniel Shahaf
44ef6e38e5
'main': Highlight several more special (non-alphabetic) parameters.
8 years ago
Daniel Shahaf
4afe670f7a
'main': Highlight shell's PID ($$) inside double quotes.
8 years ago
Daniel Shahaf
c3913e0d8e
'main': Highlight command substitutions inside double quotes.
Part of issue #139 .
8 years ago
Daniel Shahaf
4fc35362ee
'main': Permit subshells to end at command position.
Fixes #344 .
8 years ago
Daniel Shahaf
2bb8f0703d
'main': Highlight mismatched foreach/end.
Fixes #96 .
8 years ago
Daniel Shahaf
b2733a64da
'main': Highlight mismatched do/done.
8 years ago
Daniel Shahaf
2755438e80
'main': Yet another test for mismatched braces.
8 years ago
Sebastian Gniazdowski
c6b6513ac0
'main' / *_check_path: Precompute $#BUFFER and use it for speed gain
Running main highlighter on itself (both runs are on the optimized
version):
- clean (8 runs, last 3 noted):
1.7007670000
1.7330720000
1.7038810000
- optimized (8 runs, last 3 noted):
1.5007230000
1.5142960000
1.4973320000
Average difference: 0.208456
When parsing main-highlighter with itself, the *_check_path function is
called 426 times. Note that there are 686 region_highlight resulting
entries.
8 years ago
Daniel Shahaf
a053768627
dev tools: Remove a superfluous empty line.
8 years ago
Daniel Shahaf
e5782e4ddf
'main': Highlight 'always' blocks.
Fixes #335 .
8 years ago
Daniel Shahaf
8bf423d16d
'main': Don't find command positions within multiline array literals.
Fixes #333 .
8 years ago
Daniel Shahaf
a4196eda5e
'main': Restore compatibility with zsh-4.3.14 and older (after e3182c18de8f).
Fixes #368 .
8 years ago
Daniel Shahaf
6f91850a01
'main': Highlight first command word in named functions defined in the sh syntax when MULTI_FUNC_DEF is set.
Fixes a subset of issue #237 .
8 years ago
Daniel Shahaf
2fabf7ca64
'main': More tests for mismstached parentheses and braces.
8 years ago
Daniel Shahaf
51b9d79c3b
'main': Highlight mismatched parentheses and braces.
8 years ago
Daniel Shahaf
02807f1826
'main': Support the IGNORE_BRACES option.
This is related to a future "unbalanced { ( ) }" check for issue #344 .
8 years ago
Daniel Shahaf
a8a6384356
'main': Add tests for the IGNORE_BRACES option.
Also adds an XFail test for balanced braces for issue #344 .
8 years ago
Daniel Shahaf
fdaeec4514
'main': Followup to 51614ca2c994: Run cheaper conditions first.
This was suggested on #355 .
8 years ago
m0viefreak
4c4baede51
'brackets': Don't highlight corresponding bracket on accept-line
8 years ago
Daniel Shahaf
51614ca2c9
'main': Avoid triggering a zsh bug related to hashed commands.
This manifested in completion of the form «./foo<TAB>» where there happened to
be a program called 'foo' in $PATH.
Fixes #354 .
Closes #355 .
8 years ago
Daniel Shahaf
c793e0dcea
highlighters: Rename entry points.
This tracks the API change made in the previous commit, as suggested in the
(#if 0'd) deprecation warning.
8 years ago
Daniel Shahaf
2c002f9f89
noop: Add comments.
8 years ago
Daniel Shahaf
757d047f09
'main': The word after 'sudo' is only a non-command word if it is an option.
8 years ago
Daniel Shahaf
179b8e753f
'main': Test for redirection earlier.
This is a prerequisite for the next commit.
The incumbent code was wrong: the test of $in_redirection in the first hunk
would never have seen «(( in_redirection == 2 ))». That had no visible
effect since options to sudo don't look like redirection operators.
8 years ago
Daniel Shahaf
6e2ef574c8
noop: Restructure code for clarity.
The structure now mirrors the stall construct at the top of the loop.
8 years ago
Daniel Shahaf
d1c773faa7
noop: Fix indentation.
8 years ago
m0viefreak
5bae621900
driver: Always bind zle-line-finish and use it instead of accept-*
Special handling for cursor imprint or partial path highlighting
is needed in more cases than accept-*. For example when accepting
a line from isearch, no accept-* widget is invoked.
The proper way is to use zle-line-finish.
Trumps #259 .
Fixes #284 .
8 years ago
Daniel Shahaf
fa57633d81
'main': Enable test for issue #238 .
8 years ago
Daniel Shahaf
0d41933c61
'main': Add test for issue #343 , concerning the 'command' precommand.
8 years ago
Daniel Shahaf
6b69389bd9
'main': New test, related to issue #328 .
The test passes so I'm adding it directly to master.
8 years ago
Daniel Shahaf
3409a2e4d2
*: s/echo/print/
Just in case one of the interpolated variables contains a backslash.
8 years ago
Daniel Shahaf
53083da821
'main': Highlight a broken symlink as a file.
Fixes #342 .
8 years ago
Daniel Shahaf
95f7206a93
tests: Add an XFail test for issue #342 .
8 years ago
Daniel Shahaf
ee07588cfd
tests: Add a regression test for issue #267 , concerning highlighting a vi linewise region.
8 years ago
m0viefreak
9a934d291e
'main': Path separators: Leave styles empty by default
If the separator feature is disabled, this makes it possible to
change the main 'path' styles in a running session without the
need to touch the '_pathseparator' styles, too.
8 years ago
Daniel Shahaf
d9e07b5082
'main': simple parameter expansions at command word: Don't use an undefined value.
Causes such expansions to be highlighted as [unknown-token] rather than as default (absent from $region_highlight).
Fixes #337 .
8 years ago