Daniel Shahaf
fdaeec4514
'main': Followup to 51614ca2c9: Run cheaper conditions first.
...
This was suggested on #355 .
2016-09-08 19:09:29 +00:00
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 .
2016-08-30 02:56:23 +00:00
Daniel Shahaf
11c9081967
*: error messages: Fix quoting.
2016-08-16 19:01:25 +00:00
Daniel Shahaf
c7f7d2ff16
*: Change highlighters' namespace.
...
Fixes #329 .
Merge remote-tracking branch 'danielsh/i329-v1'
* danielsh/i329-v1:
highlighters: Rename entry points.
driver: Rename highlighter entry points
2016-08-16 17:53:01 +00:00
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.
2016-08-16 17:51:43 +00:00
Daniel Shahaf
a3d5dfcbda
driver: Rename highlighter entry points
...
This updates the docs and the driver, in a manner backwards compatible with
existing highlighters. (None of the highlighters are touched by this change,
yet tests continue to pass.)
Part of issue #329 .
2016-08-16 17:51:43 +00:00
Daniel Shahaf
f91a7b885e
driver: Followup to 80148f6c84: don't squat on the highlighters' namespace.
2016-08-16 17:49:18 +00:00
Daniel Shahaf
f3242cbd6a
driver: Followup to d711563fe1: actually make the driver reentrant.
...
Re-fixes #305 .
2016-08-16 17:22:39 +00:00
Daniel Shahaf
b2ba91f12f
noop: Rewrap.
2016-08-16 17:09:42 +00:00
Daniel Shahaf
d1e0defceb
README: Add a reference to upstream's documentation.
2016-08-16 17:09:04 +00:00
Daniel Shahaf
b7bb4f8657
README: Rephrase a question non-negatively^W neutrally.
2016-08-16 17:08:47 +00:00
Daniel Shahaf
2c002f9f89
noop: Add comments.
2016-08-16 13:40:31 +00:00
Daniel Shahaf
757d047f09
'main': The word after 'sudo' is only a non-command word if it is an option.
2016-08-16 13:31:05 +00:00
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.
2016-08-16 13:27:36 +00:00
Daniel Shahaf
6e2ef574c8
noop: Restructure code for clarity.
...
The structure now mirrors the stall construct at the top of the loop.
2016-08-16 13:25:43 +00:00
Daniel Shahaf
d1c773faa7
noop: Fix indentation.
2016-08-16 13:00:55 +00:00
Daniel Shahaf
295d62ec88
driver: Followup to last: make the value more unique.
...
Part of issue #305 .
2016-08-12 09:43:54 +00:00
Daniel Shahaf
d711563fe1
driver: Make it reentrant.
...
This fixes an infinite recursion in zsh without zle-line-pre-redraw [≤5.2] in
the following situation:
% source zsh-syntax-highlighting.zsh
% eval "my-self-insert() { zle -M 'foobar'; ${(q)widgets[self-insert]#*:} \"\$@\" }"
% zle -N self-insert my-self-insert
% source zsh-syntax-highlighting.zsh
Fixes #305 .
2016-08-12 09:19:36 +00:00
Daniel Shahaf
e2f863c151
minor: Fix typo in development usage message.
2016-08-12 09:19:36 +00:00
Daniel Shahaf
171a4eec2d
Merge remote-tracking branch 'danielsh/m0vie-i288-v2' (revised version of upstream/pr/288)
...
* danielsh/m0vie-i288-v2:
driver: Don't highlight in isearch
driver: Always bind zle-line-finish and use it instead of accept-*
driver: Widget binding: Support binding incomplete/nonexistent widgets
2016-07-29 21:09:31 +00:00
Daniel Shahaf
add6825898
dev tools: Extend tests/generate.zsh.
2016-07-29 19:02:40 +00:00
Daniel Shahaf
8013dc3b8d
dev tools: Add a script that generates a test-data file.
2016-07-29 18:58:37 +00:00
Daniel Shahaf
fa57633d81
'main': Enable test for issue #238 .
2016-07-28 08:14:23 +00:00
Daniel Shahaf
0d41933c61
'main': Add test for issue #343 , concerning the 'command' precommand.
2016-07-28 07:54:28 +00:00
Daniel Shahaf
e6fb61c42b
'main': Highlight a broken symlink as a file.
...
Merge remote-tracking branch 'upstream/pr/342'
* upstream/pr/342:
'main': Highlight a broken symlink as a file.
tests: Add an XFail test for issue #342 .
2016-07-22 16:09:06 +00:00
Daniel Shahaf
6b69389bd9
'main': New test, related to issue #328 .
...
The test passes so I'm adding it directly to master.
2016-07-22 15:52:43 +00:00
Daniel Shahaf
3409a2e4d2
*: s/echo/print/
...
Just in case one of the interpolated variables contains a backslash.
2016-07-21 04:01:50 +00:00
Daniel Shahaf
53083da821
'main': Highlight a broken symlink as a file.
...
Fixes #342 .
2016-07-20 02:01:15 +00:00
Daniel Shahaf
95f7206a93
tests: Add an XFail test for issue #342 .
2016-07-20 02:00:28 +00:00
Daniel Shahaf
fffe13a8fb
docs: Minor tweak.
...
Suggested-by: Matthew Martin
2016-07-18 04:27:54 +00:00
Daniel Shahaf
80148f6c84
docs: State highlighters' designated namespace.
2016-07-12 07:05:37 +00:00
Daniel Shahaf
ba16cf2fb2
docs: s/myhighlighter/acme/g
...
Makes the text easier to read ("_zsh_highlight_myhighlighter_highlighter" is
a mouthful).
2016-07-12 07:03:18 +00:00
Daniel Shahaf
3e59ab41b6
driver: Change a variable name to avoid squatting the highlighters' namespace.
...
Part of issue #329 .
2016-07-12 06:50:49 +00:00
Daniel Shahaf
d13da0cf00
'main': Support vi linewise region (REGION_ACTIVE == 2).
...
Merge remote-tracking branch 'danielshahaf/i267-linewise-region-v1'
* danielsh/i267-linewise-region-v1:
tests: Add a regression test for issue #267 , concerning highlighting a vi linewise region.
Support linewise region.
2016-07-01 02:00:10 +00:00
Daniel Shahaf
ee07588cfd
tests: Add a regression test for issue #267 , concerning highlighting a vi linewise region.
2016-07-01 01:59:37 +00:00
Daniel Shahaf
750aebc553
driver: Stop requiring function_argzero.
...
Instead, use the %N prompt expando, as suggested by Bart in users/21637.
Avoid the `print -P %N` syntax to save a fork on Cygwin, at the expense
of not supporting zsh's from 2001 through c. 2004 vintages.
Fixes #338 .
2016-06-10 15:18:46 +00:00
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 .
2016-06-10 14:31:57 +00:00
Daniel Shahaf
da91264122
'main': Add missing arguments.
...
Part of #337 .
2016-06-10 14:31:57 +00:00
Daniel Shahaf
e35a0b256e
'main': Try the "non-command word" codepath when a word may be either a command word or a non-command word.
...
Merge remote-tracking branch 'upstream/pr/331'
* upstream/pr/331:
'main': Try the "non-command word" codepath when a word may be either a command word or a non-command word.
2016-06-05 16:58:12 +00:00
Daniel Shahaf
10a596f9fd
dev docs: Document a useful tab completion setting.
2016-06-03 08:46:30 +00:00
Daniel Shahaf
4b77af73fb
minor: Fix typo in comment.
...
Two instances.
2016-06-03 08:41:45 +00:00
Daniel Shahaf
47144ad974
'main': Fix issue #290 , «Mishighlights "longloops" 'repeat'».
...
* upstream/pr/319:
tests: Extend issue #290 test with another variant.
'main': Fix issue #290 , «Mishighlights "longloops" 'repeat'».
tests: New test for issue #290 , «Mishighlights "longloops" 'repeat'».
2016-06-03 04:32:25 +00:00
Daniel Shahaf
7fb6f99791
'main': Try the "non-command word" codepath when a word may be either a command word or a non-command word.
...
Fixes #231 .
Fixes #330 .
2016-06-03 04:25:00 +00:00
Daniel Shahaf
fccf92402b
minor: tests: Formatting tweak to XPASS output.
...
Remove superfluous single quotes around the second hyphen.
2016-06-03 03:57:45 +00:00
Daniel Shahaf
29b30e0ca7
'main': Add XFail test for issue #330 , concerning command word after array assignment.
2016-06-03 03:42:12 +00:00
Daniel Shahaf
f4036a09ce
'main': Highlight scalar assignments to argv
...
Assignments to positional parameters using scalar assignment syntax is
a feature: it is covered by upstream's test suite ("append to positional
parameter" in Test/A06assign.ztst).
2016-06-03 03:27:52 +00:00
Daniel Shahaf
14711a51f3
tests: Explicitly test 'default' style inside an array assignment.
2016-06-03 02:41:10 +00:00
Daniel Shahaf
f060622dc6
'main': Internal cleanup: drop $style_override.
...
Merge remote-tracking branch 'upstream/pr/326'
* upstream/pr/326:
'main': Internal cleanup: drop $style_override.
Conflicts:
highlighters/main/main-highlighter.zsh (context lines only)
2016-06-01 05:45:39 +00:00
Daniel Shahaf
a5b8bc0ef0
'main': Internal cleanup: drop $style_override.
...
Changes the interface of _zsh_highlight_main_highlighter_check_path().
Suggested-by: m0viefreak
2016-05-27 10:21:28 +00:00
Daniel Shahaf
6362c757b6
tests: Extend issue #290 test with another variant.
...
The test being extended is highlighters/main/test-data/control-flow2.zsh.
2016-05-13 04:28:43 +00:00
Daniel Shahaf
ef68f50c04
'main': Fix issue #290 , «Mishighlights "longloops" 'repeat'».
2016-05-13 03:30:11 +00:00
Daniel Shahaf
4832f18c50
tests: New test for issue #290 , «Mishighlights "longloops" 'repeat'».
2016-05-13 02:50:24 +00:00
Daniel Shahaf
f146651913
Merge part of PR #298
...
* commit '2f18ba':
'main': use zsh/parameter to resolve alias
driver: load zsh/parameter if available
2016-05-13 02:27:29 +00:00
Daniel Shahaf
def8c0da83
Bump copyright years.
2016-05-13 01:29:49 +00:00
Daniel Shahaf
4f5bb6cf96
Merge remote-tracking branch 'upstream/pr/308' into HEAD
...
* upstream/pr/308:
'main': Fix issue #302 , "Process substitution misparsed as redirection".
'main': Factor out common code. No functional change.
'main': Add a regression test for issue #302 , "Process substitution misparsed as redirection".
2016-05-13 01:24:01 +00:00
Daniel Shahaf
0ff354b44b
docs: Namespace highlighters' styles.
...
Follow-up to 2176692704 .
Part of #306 .
2016-05-12 19:28:17 +00:00
Daniel Shahaf
7b82b88a71
'main': Don't leak the PATH_DIRS options.
...
Found-by: m0viefreak
(in #298 )
2016-05-12 19:24:00 +00:00
Daniel Shahaf
5a98cd3a10
Merge remote-tracking branch 'upstream/pr/315' into HEAD
...
* upstream/pr/315:
'main': optimization that in my tests shows 2.7s -> 2.2s
2016-05-12 18:30:50 +00:00
Daniel Shahaf
162c826452
docs: Honour $ZDOTDIR in code examples.
...
Keep references in prose as '~/.zshrc': using $ZDOTDIR in that context would
be confusing, and people who set $ZDOTDIR understand these references.
2016-05-12 13:29:10 +00:00
Daniel Shahaf
a00ed24ba3
docs: Simplify/clarify installation instructions.
...
This also removes an implicit assumption that ~/.zshrc is idempotent.
2016-05-12 13:25:59 +00:00
Daniel Shahaf
62f1c108f3
tests: New test to capture off-by-ones.
...
Inspired by #312 .
2016-05-11 20:36:18 +00:00
Daniel Shahaf
a7a7f8b422
Support linewise region.
...
Fixes #267 .
2016-05-09 04:10:02 +00:00
Daniel Shahaf
15db71abd0
driver: Track rename of an unreleased upstream API.
...
ISEARCH_ACTIVE was renamed ISEARCHMATCH_ACTIVE in workers/38921
(commit f06be0ffcf2c to zsh itself).
Fixes #299 .
2016-05-09 03:38:27 +00:00
Daniel Shahaf
fc9c892a3f
'main': Fix issue #302 , "Process substitution misparsed as redirection".
2016-05-09 03:29:27 +00:00
Daniel Shahaf
bfabffbf97
'main': Factor out common code. No functional change.
2016-05-09 03:26:29 +00:00
Daniel Shahaf
6889ff6bd2
'main': Add a regression test for issue #302 , "Process substitution misparsed as redirection".
2016-05-09 03:26:06 +00:00
Daniel Shahaf
f0bae44b76
tests: Followup to last: echo(1) is evil.
...
Use 'print -r --' instead, so literal backslashes in $BUFFER aren't expanded.
Found-by: Matthew Martin
2016-05-05 20:34:43 +00:00
Daniel Shahaf
3176b9567c
minor: tests: Quote $BUFFER differently on output.
...
The new output improves readability of the 'main' highlighter's test output.
2016-05-05 19:33:56 +00:00
Daniel Shahaf
6aa57d60aa
tests: TAP support: Emit a 'description' for all test points
2016-05-05 19:11:49 +00:00
Daniel Shahaf
f83bca0847
minor: tests: Introduce a local variable. No functional change.
2016-05-05 19:11:28 +00:00
Daniel Shahaf
70b5687d66
minor: tests: Tighten up local variable scope.
2016-05-05 19:11:07 +00:00
Daniel Shahaf
21207c336a
tests: TAP compliance: Do not emit literal '#' in the 'description' part
2016-05-05 19:11:07 +00:00
Daniel Shahaf
56a867076c
tests: Followup to fd061b5730: quote both expected and actual output.
2016-05-05 19:10:06 +00:00
Daniel Shahaf
cef49752fd
dev docs: Create HACKING.md.
...
Review-by: Matthew Martin
2016-05-05 01:20:32 +00:00
Daniel Shahaf
e8af14fe1f
minor: Rewrap docs for uncompiled readability.
2016-05-03 15:00:48 +00:00
Daniel Shahaf
f34714b8ee
Bump copyright years.
2016-04-30 02:11:17 +00:00
Daniel Shahaf
c54c076cfa
cleanup: Avoid colon after parameter expansion to avoid risking introducing a colon modifier.
2016-04-24 17:08:08 +00:00
Daniel Shahaf
b52a485c5c
brackets: Optimize a tiny bit.
...
Compute «${#BUFFER}» just once. I haven't measured the effect of this, but
it might just avoid a strlen() every time around the loop, which could add
up for large ${BUFFER}s.
See issue #295 .
2016-04-22 14:14:15 +00:00
Daniel Shahaf
367929502f
release.md: Add a release checklist line item.
2016-04-05 05:49:18 +00:00
Daniel Shahaf
bc7f8ea433
'main': Restore support for zsh-4.3.10 and older.
...
zsh older than workers/28418 (zsh revision 23bdfc7fd2a012d5205ed22d18eb39e41c8fbc95)
doesn't support the «${name:offset:length}» syntax. Therefore, use the older
«$name[start,end]» syntax instead.
Followup to 3cb58fd7d7 , "Optimization: -1 is
extra computation of string length internally".
Fixes zsh-users/zsh-syntax-highlighting#279 .
2016-03-23 01:32:44 +00:00
Daniel Shahaf
cb02451a4e
widget binding: Fix crucial typo in last commit.
2016-03-18 15:14:09 +00:00
Daniel Shahaf
11d378332e
widget binding: Further unbreak the build.
...
7e7e291b20 broke 'zle -C' completions, as reported in #278 just now.
2016-03-18 15:12:04 +00:00
Daniel Shahaf
6a634fac9f
widget binding: Properly escape widget names at definition.
...
Re-Fixes zsh-users/zsh-syntax-highlighting#278 .
2016-03-18 14:53:53 +00:00
Daniel Shahaf
47a664447c
noop: Remove stray statement terminators and line joiners.
2016-03-18 14:47:53 +00:00
Daniel Shahaf
261c180a36
widget binding: Unbreak the build.
...
The last commit inadvertently broke interactive use, although the test suite passed.
See issue #278 .
2016-03-18 14:41:18 +00:00
Daniel Shahaf
7e7e291b20
widget binding: Remove an unnecessary layer of indirection.
...
The 'eval' was never needed, and the lack of proper quoting of the interpolated
variables caused issues, such as #278 .
Fixes zsh-users/zsh-syntax-highlighting#278 .
2016-03-18 13:58:55 +00:00
Daniel Shahaf
4c23a2fd1b
'main': Highlight lone '!' correctly: it's not a history expansion.
...
While here, also add a test for the '!' reserved word (which is highlighted
since c216242b ).
2016-03-13 02:47:25 +00:00
Daniel Shahaf
e635f766be
docs: Clarify oh-my-zsh installation instructions.
...
Thanks to Andrew Janke.
Fixes zsh-users/zsh-syntax-highlighting#270 .
2016-03-12 18:36:44 +00:00
Daniel Shahaf
18df692ae6
widget binding: Remove some too-wide exclusions
...
* m0vie/p_bindings:
widget binding: don't exlude widgets with identical function name
widget binding: don't exclude widgets starting with '_'
2016-03-12 17:24:03 +00:00
Daniel Shahaf
7044c1986e
docs: use https:// instead of git://
2016-02-18 13:39:24 +00:00
Daniel Shahaf
e500ca2462
'main': Don't highlight in vared
...
This is a continuation of 451665cb2a which did
the same for the $PS3 prompt.
Reported-by: Sebastian Gniazdowski
2016-02-14 17:34:53 +02:00
Daniel Shahaf
e938825a85
Merge pull request #272 from psprint/master
...
Optimization: -1 is extra computation of string length internally
2016-02-14 14:32:01 +00:00
Daniel Shahaf
683f4837a0
changelog: Update for upcoming 0.4.1 release.
2016-01-27 20:48:56 +00:00
Daniel Shahaf
62a6be3d63
Version number bump.
...
Have master self-describe as 0.5.0-dev, since an 0.4.1 release is upcoming on
another branch.
2016-01-27 20:38:38 +00:00
Daniel Shahaf
451665cb2a
'main': Don't highlight at the $PS3 prompt.
...
The input to the $PS3 prompt is not commands, so the 'main' highlighter is
not applicable to it.
Fixes zsh-users/zsh-syntax-highlighting#268 .
2016-01-20 22:10:49 +00:00
Daniel Shahaf
30d8f92df2
test harness: Properly quote error message interpolations.
...
No functional change, except that error messages are now more readable.
2016-01-20 22:02:25 +00:00
Daniel Shahaf
282c7134e8
Revert "wrapping: Don't add '--' when invoking widgets."
...
The '--' guard was correct; it was there to guard against arguments belonging
to the syntax «zle widget [ -n num ] [ -Nw ] [ -K keymap ] args».
For example, this affected using <backward-kill-word> over
BUFFER="-w "
CURSOR=3
after
autoload -Uz select-word-style
select-word-style default
zstyle ':zle:backward-kill-word' word-style shell
.
This reverts commit c808d2187a .
2016-01-17 19:43:48 +00:00
Daniel Shahaf
28932316cc
aliases: Highlight aliases with '=' in their LHS as error. (Part of issue #263.)
2016-01-11 15:27:48 +00:00
Daniel Shahaf
5e4b446dee
aliases: Add a test for one variant of issue #263 .
2016-01-11 15:07:18 +00:00
Daniel Shahaf
9b64ad750f
tests: Add a 'print failures only' mode to 'make test', called 'make quiet-test'.
...
Fixes zsh-users/zsh-syntax-highlighting#262 .
Currently, 'make quiet-test' uses Perl. However, since it is considered a development
tool rather than a user-facing tool, users and downstream packages needn't install Perl.
Furthermore, even this dev-only dependency may be dropped in the future.
The only difference between tests/tap-filter here and the one in the issue is using
a `cat` subshell v. using 'undef $/; <STDIN>'.
2016-01-02 21:22:01 +00:00