Daniel Shahaf
932e29a0c7
Tag version 0.7.1.
2020-02-28 21:34:10 +00:00
Daniel Shahaf
ec04a20681
release.md: Update with the step that was missed in 0.7.0.
2020-02-28 21:33:51 +00:00
Daniel Shahaf
cb8d68d00a
Update changelog for the 0.7.1 release.
2020-02-28 21:32:42 +00:00
Daniel Shahaf
04dd78cb00
Update changelog for the 0.7.0 release. (Yes, this should have been committed earlier today.)
2020-02-28 21:29:59 +00:00
Daniel Shahaf and Daniel Shahaf
4eb8a19133
Post-release version number bump.
2020-02-28 15:38:43 +00:00
Daniel Shahaf
36a3c0f82c
Tag version 0.7.0.
2020-02-28 15:36:43 +00:00
Daniel Shahaf
d65f4f8a35
release.md: Add details about a step.
2020-02-28 15:36:25 +00:00
Daniel Shahaf
e07c901dfd
tests: Fix the last added test to pass when sudo(8) isn't installed.
2020-02-28 15:22:43 +00:00
Daniel Shahaf
3cea1434ae
Bump copyright years.
2020-02-25 17:34:35 +00:00
Daniel Shahaf
73c89c69a2
tests: Add a test for partial elisions of parameter expansions in command position
...
See https://github.com/zsh-users/zsh-syntax-highlighting/commit/1a55dc8fc28cf1049ba8ff33694d3e56678cad17#commitcomment-37476021
2020-02-25 17:22:55 +00:00
Matthew Martin
7fd44bc429
tests: Fix previous
2020-02-25 07:37:09 -06:00
Matthew Martin
ab88dfad27
tests: Add main test for alias of a parameter like string
2020-02-25 07:21:40 -06:00
Daniel Shahaf
2b3638a211
test harness: Tweak quiet-test output
...
- Print the test name and data after the plan line
- Split on the plan line rather than on comments
+ That makes tap-filter more suitable to filter TAP output generated by other
TAP producers.
+ However, the filtered output deletes the plan line and adds a blank line in
its stead. This suits our use-case of interactive test runs.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
3414c7c0d2
test harness: Include $PREBUFFER and $BUFFER in the output.
...
For human readers' benefit.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
4a043b4d15
noop: Whitespace changes only.
...
./.editorconfig is already set correctly.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
dc70e89bfd
tests: Support non-arrays in typeset_p().
2020-02-22 15:12:24 +00:00
Daniel Shahaf
f729726300
'main': Do not look for metacharacters in parameter expansions.
...
Fixes the bug the previous commit added a test for.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
f490b7cb95
'main': Add two tests for metacharacters in parameter expansions.
...
Suggested-by: @QBobWatson
(in https://github.com/zsh-users/zsh-syntax-highlighting/pull/682#issuecomment-588361771 )
2020-02-22 15:12:24 +00:00
Daniel Shahaf
2f4f81cab7
'main': Parameter expansions may not contain assignments.
...
In «a="b=c"; $a», the '=' sign in the expansion of $a is not active.
Therefore, prevent the expansion of $a from being considered an
assignment. Update test expectations accordingly.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
3558306149
tests: Add tests for issue #670 .
...
Before the parent commit, they behaved as follows:
ZSH_PATCHLEVEL=debian/5.7.1-1
# parameter-value-contains-command-position1
1..2
ok 1 - [1,7] «$foobar» - # TODO "issue #670 "
not ok 2 - have 1 expectations and 6 region_highlight entries: «expected_region_highlight=( '1 7 assign "issue ♯670"' )» «region_highlight=( '0 7 assign' '2 7 default' '2 7 command-substitution-unquoted'
zsh-syntax-highlighting: BUG: _zsh_highlight_highlighter_main_paint: start(2) >= end(2)
Bail out! On './highlighters/main/test-data/parameter-value-contains-command-position2.zsh': output on stderr
# parameter-value-contains-command-position2
1..2
ok 1 - [1,2] «$y» - # TODO "issue #670 "
ok 2 - cardinality check
Due to the the "BUG:" and "Bail out!" on the first one, they could not
be added as XFAIL tests before the parent commit.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
1a55dc8fc2
'main': Pass parameters through the multi-word machinery, as we already do for aliases.
...
Fixes #674 .
2020-02-22 15:12:24 +00:00
Daniel Shahaf
52ea5c686a
'main': precommands += chronic, ifne (from moreutils)
...
Fixes #681 .
2020-02-17 10:20:13 +00:00
Manaswini Das and Daniel Shahaf
dde84e1b25
docs: Fix typo
...
Fixes #679
2020-01-28 07:44:52 +00:00
Matthew Martin
0e51046b19
main: Add tests for issue #678
2020-01-25 15:51:16 -06:00
Daniel Shahaf
4e92449752
changelog: Document #670 as a known issue.
2020-01-25 21:00:40 +00:00
Daniel Shahaf
b73853dd96
changelog: Document #677 as a known issue.
2020-01-24 18:40:51 +00:00
Daniel Shahaf
4546756500
tests: Fix another instance of issue from the last commit.
2020-01-24 01:22:03 +00:00
Daniel Shahaf
9d380805d7
tests: Unbreak the build on zsh 5.0.8 and older.
2020-01-24 00:51:27 +00:00
Daniel Shahaf
deee22ed42
tests: Don't filter out tests that aborted.
...
Useful in piping Travis CI output through tap-filter manually.
2020-01-24 00:49:51 +00:00
Daniel Shahaf
77c6bf2019
'main': precommands: Remove argumentless options that can't be followed by a command word.
...
Suggested-by: Matthew Martin
(in https://github.com/zsh-users/zsh-syntax-highlighting/commit/e2e97dde9c92bf27d8222482a08e2b77d66ac334#r36941988 )
2020-01-24 00:37:56 +00:00
Daniel Shahaf
27e4789439
docs: Track FreeBSD port rename
...
See https://svnweb.freebsd.org/ports?revision=501751&view=revision
2020-01-23 22:09:33 +00:00
Daniel Shahaf
e2e97dde9c
'main': Support tabbed(1) from suckless-tools
2020-01-22 04:44:27 +00:00
Daniel Shahaf
9bf06c5c2a
tests: Add a regression test for issue #676 .
2020-01-20 03:49:00 +00:00
Daniel Shahaf
dfb917020c
Bump copyright years.
2020-01-16 17:19:25 +00:00
Daniel Shahaf
9ed2a46ed2
dev tools: New script to ease opening $EDITOR on failing tests.
...
Has room for improvement; for now, I use it with CTRL-W_f.
2020-01-16 17:19:25 +00:00
Daniel Shahaf
1c6a6d92b0
dev tools: Allow specifying preamble code when generating test cases.
2020-01-16 17:19:25 +00:00
Daniel Shahaf
6b0671b63e
Add .editorconfig file.
...
Vim doesn't honour the modelines by default because they're too far from
the start/end of the file [the default value of the 'modelines' (sic)
option is too small].
2020-01-16 17:19:25 +00:00
Daniel Shahaf
b3b6d7129f
tests: Add failing tests for issue #674 .
2020-01-16 16:12:14 +00:00
Daniel Shahaf
9cb7e9a837
tests: Make sudo-longopt pass when sudo isn't installed.
...
Fixes #673 .
2020-01-16 15:49:27 +00:00
Daniel Shahaf and Daniel Shahaf
cb166dcc77
'main': Restore 0.6.0's behaviour for unknown options.
...
See discussion on #664 .
2020-01-14 23:08:50 +00:00
Daniel Shahaf and Daniel Shahaf
5012d771f3
'main': Don't highlight unknown precommand flags as errors.
...
We cannot now for sure whether the flag is misspelled or simply unknown to us,
so err on the side of caution. This fixes an unreleased regression. Fixes #658 .
Issue #641 was originally filed about this problem, but is left open to track
further enhancements.
2020-01-14 23:08:50 +00:00
Daniel Shahaf and Daniel Shahaf
3a6f7e7bfe
'main': Add an XFail test for #641 and #658 .
2020-01-14 23:08:50 +00:00
Daniel Shahaf
521fedfdf5
'main': Change the issue a test is associated with.
...
Issue #202 is too overloaded.
2020-01-12 19:32:44 +00:00
Daniel Shahaf
1618848df6
'main': Add some tests for complete and partial absolute paths in command position.
2020-01-12 19:29:46 +00:00
Daniel Shahaf and Daniel Shahaf
c3293ba0d8
'main': Update comments after last commit. No functional change.
2020-01-12 18:34:49 +00:00
Daniel Shahaf and Daniel Shahaf
21cdd6bc5e
'main': Simplify alias handling.
...
$last_alias isn't needed; there's no reason to treat loops of length 2
(alias a=b b=a) differently to loops of length 1 (alias a=a), length 3
(alias a=b b=c c=a), or length N.
The «(( $+seen_alias[$arg] ))» check is redundant as of the last commit:
the enclosing condition ensures that $res is "alias", which implies that
«(( $+seen_alias[$arg] ))» is false.
2020-01-12 18:34:49 +00:00
Daniel Shahaf and Daniel Shahaf
f32d1704b1
'main': Fix issue #652 .
2020-01-12 18:34:49 +00:00
Daniel Shahaf and Daniel Shahaf
86fe054005
'main': precommands += ssh-agent
2020-01-12 17:21:59 +00:00
Daniel Shahaf
533bfa0116
'main': Fix the new 'backslash' test on zsh-5.0.2 and older. (The bug
...
occurred on zsh-5.0.7 and older but I don't have zsh-5.0.7 handy to test
on.)
Evidently, the issue was due to elision.
This addresses #665.0 and #665.5.
2020-01-12 17:10:34 +00:00
Daniel Shahaf and Daniel Shahaf
2d0dddf58b
'main': Don't dequote the word in command position before analyzing it.
...
Fixes #656 .
Fixes #660 .
Regression from commit e1ecf950e2 ,
"main: Do path expanstion after alias expansion" (sic).
2020-01-12 16:11:09 +00:00
Daniel Shahaf
27fa4a6546
noop: Quote the bitflag values.
...
Now every instance of «:foo:» is ''-quoted. This enables $EDITOR to highlight
them consistently throughout the file.
2020-01-12 15:46:22 +00:00
Daniel Shahaf
ae5ad09cf5
Bump copyright years.
2020-01-12 14:58:56 +00:00
Daniel Shahaf
3ee5aa0e06
release.md: Add missing argument.
2020-01-11 23:43:23 +00:00
Daniel Shahaf and Daniel Shahaf
eb277cdcc6
Post-release version number bump.
2020-01-11 23:42:31 +00:00
Daniel Shahaf
71dc090d02
Tag version 0.7.0-beta1.
2020-01-11 23:34:58 +00:00
Daniel Shahaf
6a310ada5b
changelog: Add three entries
2020-01-11 23:31:18 +00:00
Daniel Shahaf
c1d5790c57
changelog: Start 0.7.0's changelog.
2020-01-11 23:10:28 +00:00
Daniel Shahaf
e9b1ce1a36
Add a unit test for dc1b2f6fa4.
2020-01-11 23:04:22 +00:00
Daniel Shahaf
68fbe1a449
Add a test for redirection from/to process substitution.
...
Inspired by ab1013ae0d .
2020-01-11 21:47:34 +00:00
Daniel Shahaf
f02c0bf980
Don't describe as ZSH_HIGHLIGHT_DIRS_BLACKLIST as experimental, now that it's named without the X_ prefix.
2020-01-11 21:32:21 +00:00
Daniel Shahaf
1be58a6f45
Add a test for 2f03b6d704.
2020-01-11 21:19:52 +00:00
Daniel Shahaf
c0ad50e645
dev tools: Fix regression introduced in commit "Print the test data to stdout for convenience.".
...
tee(1) truncated $fname. Fortunately, the data that got truncated had just
been `git add`-ed, so no harm was done.
2020-01-11 20:49:12 +00:00
Daniel Shahaf
8b2768ab40
'main': Add a test for 07f259f653.
2020-01-11 20:46:14 +00:00
Daniel Shahaf
6f1f595e3e
dev tools: Print the test data to stdout for convenience.
2020-01-07 19:59:49 +00:00
Daniel Shahaf
de95d50bce
'main': Fix highlighting of the 'time' and 'nocorrect reserved words
...
Also add tests.
'time' is a regression from 6647e88606
(last Wednesday).
2019-12-27 13:47:31 +00:00
Daniel Shahaf
83862c1abb
'main': Add two basic tests for aliases.
2019-12-27 09:37:23 +00:00
Daniel Shahaf
ce10f20e77
'main': Add a regression test for #652 .
2019-12-27 09:00:36 +00:00
Daniel Shahaf
6647e88606
'main': Add some precommands.
2019-12-25 10:53:42 +00:00
Matthew Martin
e7d3fbc50b
main: Add test for previous
2019-11-07 19:59:00 -06:00
Matthew Martin
139ea2b189
main: Avoid $end_pos when calculating $arg size
...
Fixes second issue filed under #617
https://github.com/zsh-users/zsh-syntax-highlighting/issues/617#issuecomment-551253422
In the case of a command substitution in an alias, $arg[i,end_pos] would
not pass to the end of $arg and i <= start_pos - end_pos would not
iterate over all of $arg. Use $arg[i,-1] and $#arg respectively to avoid
issues in aliases.
2019-11-07 19:50:17 -06:00
Oliver Kiddle and Daniel Shahaf
be3882aeb0
driver: adjust region end for vi command mode
2019-10-17 21:18:56 +00:00
Daniel Shahaf
35c8690c00
release.md: Document that release tags should be signed.
...
That's how the previous tags were done.
2019-08-01 15:02:07 +00:00
Matthew Martin
b55832c5f8
main: Drop X_ from X_ZSH_HIGHLIGHT_DIRS_BLACKLIST
2019-07-24 07:27:54 -05:00
Daniel Shahaf
8e78e9dbba
'main': Fix issue #623 by fixing the expectations of the regression test of issue #616 .
2019-07-21 01:44:19 +00:00
Matthew Martin
2bd709fc28
main: Fix misspelling in test expectation
2019-07-20 10:38:53 -05:00
Matthew Martin
1fcd786f77
main: Add more alias tests
...
Suggested by Daniel.
2019-07-20 10:36:57 -05:00
Matthew Martin
369620dd2d
main: Use longer alias name in tests
2019-07-20 10:32:34 -05:00
Matthew Martin
9cc0060334
main: Stop highlighting alias as its first word too
...
Fixes #565 and #576
2019-07-20 10:32:12 -05:00
Matthew Martin
a88d41e095
main: Fix faulty test
...
sudo -e does not take a command, so use another flag that does.
2019-07-11 21:15:01 -05:00
Matthew Martin
b3f66fc874
main: Use zsyh_user_options when splitting alias RHS
2019-07-11 21:15:01 -05:00
Matthew Martin
83249e1b23
main: Do not highlight empty region between two adjacent $()
...
Should fix #624
2019-07-08 17:05:42 -05:00
Daniel Shahaf
ab4b6f5823
'main': Hackily unbreak 'make test'.
...
The test point is XPASSing, which makes CI red. As a duct tape measure to turn
CI green again, update the test expectations to make it XFAIL. The hacky part
is that the expectation set by this commit will never be met; the test point
will never XPASS now until its expectations are changed again.
Issue #623 remains open to track setting the test expectation to the correct
value (i.e., make the test XFAIL in a manner that _will_ XPASS if the bug is
fixed; in other words, pay off the technical debt created by this commit).
Issue #616 remains open to fix the actual bug.
2019-07-07 18:36:38 +00:00
Daniel Shahaf
d766243f7a
'main': Add an XFail regression test for issue #616 .
2019-06-16 21:42:21 +00:00
Daniel Shahaf
fd4c5db4c9
'main': Fix an issue whereby a --option was highlighted as a file
...
Regression test included.
Fixes #578 .
Review-by: Matthew Martin
2019-06-16 20:25:34 +00:00
Julien Nicoulaud
650dd79d86
tests: use zshusers/zsh image with tags (see zsh-users/zsh-docker#16 )
2019-05-25 13:59:59 +02:00
Matthew Martin
82cf2527fc
'main': Add test for #548
...
Closes #548
2019-04-19 19:48:01 -05:00
Matthew Martin
972ad197c1
driver: Disable BASH_REMATCH
...
Fixes #612 .
2019-04-14 08:26:03 -05:00
Matthew Martin
7ba4f0f119
'main': Use nice for tests in previous
...
stdbuf is not present on all systems. nice is not builtin and is POSIX.
2019-04-04 21:52:51 -05:00
Daniel Shahaf
bc3f77f719
'main': Add XFailing tests for issue #608 .
2019-03-29 17:50:49 +00:00
Daniel Shahaf
5f80147c55
'main': Follow-up to last commit: Fix stdbuf options spec.
...
The effect of the bug was that «-:» was considered an option taking an argument
(see the parsing of the associative array in lines 692-693).
As to preventing recurrence, add a warning comment. We _could_ change
the separator from colon to something else, but colon is idiomatic for
this use (see, e.g., passwd(5)), and the problem will be unlikely to
recur if and when we add a third field to the assoc's values. (For
example, jexec(1), chroot(1), and even ssh(1) would benefit from a third
field saying how many positional arguments to skip before the positional
argument that's to be the command word — though in the last two cases,
specifying an "inner" command is optional.)
2019-03-27 11:45:17 +00:00
Daniel Shahaf
3e86ef59b7
'main': precommands += stdbuf
2019-03-26 22:04:50 +00:00
Matthew Martin
a109ab54f0
CI: Add zsh 5.7 and 5.7.1
2019-03-21 22:59:11 -05:00
Daniel Shahaf
809443f5c5
'main': Add the issue number for future reference.
2019-03-16 07:49:04 +00:00
Daniel Shahaf
abec25d013
'main': _zsh_highlight_main__type: Add comments.
2019-03-16 07:47:53 +00:00
Daniel Shahaf
79596a84be
'main': Document the last change.
2019-03-16 07:45:23 +00:00
Daniel Shahaf
37d6108215
'main': Work around a zsh bug reported to us as #606 .
...
As of this writing, it seems that the 'type' builtin poisons the commands hash
in a way that breaks AUTO_CD to absolute paths that don't end with a slash.
2019-03-16 07:34:12 +00:00
Timm and Matthew Martin
d61ebbcbbf
docs: Fix void-linux link
2019-01-31 18:27:34 -06:00
Matthew Martin and GitHub
2f3b98ff6f
Merge pull request #543 from Sea-n/patch-1
...
Add Markdown Syntax Highlight
2019-01-13 13:48:45 -06:00
Sean Wei
4fb570e104
docs: Enable Syntax Highlighting for Code Snippits
2019-01-13 16:12:41 +08:00
Matthew Martin
693757bfd7
tests: Run harness in an anon function to catch global variables
...
Thanks Daniel for the set -- suggestion.
2019-01-12 00:36:42 -06:00
Matthew Martin
1e34c4aa0b
main: in arguments starting with %?, ? is not a glob
...
Fixes #596
2019-01-06 22:23:10 -06:00
Matthew Martin
3259fe338d
Revert "tests: Run tests in an anon function to catch global variables"
...
This reverts commit ba2d8fcf76 .
Breaks 4.3.12 and .11
2019-01-06 21:38:13 -06:00
Matthew Martin
ba2d8fcf76
tests: Run tests in an anon function to catch global variables
...
This would have caught #593 .
2019-01-06 21:23:46 -06:00
Matthew Martin
9bd38c6fc0
tests: Use root variable for root of the project
2019-01-06 21:21:42 -06:00
Matthew Martin
dddea5d5dd
tests: Set harness variables local
2019-01-06 21:18:41 -06:00
Daniel Shahaf
9a06c28ddc
docs: Don't recommend to source .zshrc
...
That might not be idempotent (cf #598 ).
2019-01-05 21:27:09 +00:00
Daniel Shahaf and GitHub
fd57ed94f1
docs: Clarify installation instructions (cf #598 )
2019-01-05 19:12:59 +00:00
Daniel Shahaf
78b95b0695
Add a test for the 'true negative' case of issue #596 .
2018-12-31 17:57:53 +00:00
Daniel Shahaf
06893a3873
tests: Escape region_highlight and expected_region_highlight in TAP output.
...
Required for TAP compliance in case the output ever contains '#' or '\n'.
2018-12-29 12:15:34 +00:00
Daniel Shahaf
580ccaebb8
tests: (try to) Fix test failure under zsh<5.3, where 'typeset -p arrayvar''s is two lines long.
2018-12-29 11:57:15 +00:00
Daniel Shahaf
7cb5ad0f9b
tests: Tweak XFAIL/XPASS output of cardinality check.
...
Stylistic tweaks only; no functional change, no effect on TAP compliance.
2018-12-29 11:46:18 +00:00
Daniel Shahaf
cd1647f4d4
tests: Follow-up to grandparent: Make the cardinality check XPASS properly when it should.
2018-12-29 11:42:34 +00:00
Daniel Shahaf
0efad58f30
Add a test for issue #596 .
2018-12-29 11:31:50 +00:00
Daniel Shahaf
864864442e
tests: Allow marking the cardinality check as TODO (XFail).
...
Needed for next commit.
2018-12-29 11:31:18 +00:00
dana and Daniel Shahaf
55f846c673
driver: Avoid warn_create_global warnings
2018-12-20 12:48:14 +00:00
Tobias Sette and Daniel Shahaf
3dc74b5c2c
pattern, regexp: Declare the variable in the documentation example
...
Fixes #590 .
2018-12-14 10:21:55 +00:00
Daniel Shahaf
e900ad8bad
main: Add another test, inspired by #577 and #502 .
2018-11-01 04:01:33 +00:00
Daniel Shahaf
f087f3c6e4
main: Add a test for issue #577 .
2018-11-01 04:01:05 +00:00
Daniel Shahaf
3e6d1375c9
main: Fix check for suffix aliases ( fixes #574 )
2018-10-30 21:25:59 +00:00
Daniel Shahaf
4ce56a821e
Merge branch 'i511-bang-pipeline'
...
* i511-bang-pipeline:
main: Fold '!' handling in to the 'case'. No functional change.
Fix indentation. No functional change.
main: Fix highlighting of the ! precommand after array assignments. Add tests.
main: Highlight the ! precommand as an error when not at the start of a pipeline.
2018-10-23 16:58:33 +00:00
Daniel Shahaf
44b89f3307
main: Fold '!' handling in to the 'case'. No functional change.
2018-10-23 16:36:14 +00:00
Daniel Shahaf
0c9252ac69
Fix indentation. No functional change.
2018-10-23 16:34:35 +00:00
Daniel Shahaf
6cf522b7b3
main: Fix highlighting of the ! precommand after array assignments. Add tests.
2018-10-23 16:31:39 +00:00
Daniel Shahaf
298ef6a2fa
main: Highlight the ! precommand as an error when not at the start of a pipeline.
...
Fixes #511 .
2018-10-23 16:31:00 +00:00
Matthew Martin
d9e326b993
main: consume trailing whitespace in _highlight_list
...
Fixes highlighting when an unclosed $( ends in whitespace.
2018-10-22 07:53:18 -05:00
Matthew Martin
48a20d067f
main: Break double-quoted-argument on command substitutions
2018-10-22 07:53:18 -05:00
Daniel Shahaf
6539f0d419
'main': Highlight named fd redirections.
...
Merge remote-tracking branch 'danielsh/i238-named-fd-redirection-v1'
* danielsh/i238-named-fd-redirection-v1:
'main': Tighten condition.
noop: Tweak condition at Matthew's suggestion
'main': Highlight named fd redirections.
2018-10-22 05:00:07 +00:00
Daniel Shahaf
7d961ba1e6
'main': Add a test for issue #237 .
2018-10-22 04:58:57 +00:00
Daniel Shahaf
ad3a6cb3c9
'main': Tighten condition.
...
Should rule out brace expansions such as '{foo,bar}' and '{10..20}'.
2018-10-22 04:56:50 +00:00
Daniel Shahaf
9870ccc505
noop: Tweak condition at Matthew's suggestion
2018-10-22 04:54:11 +00:00
Daniel Shahaf
38c794a978
'main': Highlight named fd redirections.
...
Fixes #238
2018-10-22 04:33:11 +00:00
Daniel Shahaf
de23e75946
minor: Fix the editor braces matching confusion prevention sentinel.
2018-10-22 04:27:18 +00:00
Matthew Martin
a3c9e7ebc7
main: Simplify insane alias checking
2018-10-21 14:59:52 -05:00
Matthew Martin
f71a17c58e
main: Highlight closing brackets
...
Closes #226
2018-10-21 12:10:07 -05:00
Matthew Martin
d0c23a68b3
main: Simplify proc_buf offset calculation
...
Fixes #347
2018-10-20 23:48:39 -05:00
Matthew Martin
7388adf4e8
main: Add alias tests
2018-10-20 20:57:45 -05:00
Matthew Martin
cb8c736a56
main: Run the entirety of aliases through the state machine
...
Fixes #540 #544 #552 #554 #555
2018-10-20 20:57:45 -05:00
Matthew Martin
2d4fe988ba
main: Rename parameters to simplify next diff
2018-10-20 20:18:46 -05:00
Matthew Martin
8f17e4e201
main: Add trivial condition and remove whitespace to simplify next diff
2018-10-20 20:18:46 -05:00
Daniel Shahaf and Matthew Martin
02f4a6b540
'main': Optionally ignore aliases in __type
2018-10-20 20:18:46 -05:00
Matthew Martin
b9d7fe5a43
main: Shift args rather than iterating over
...
No functional change. Prepares for running a full alias through the
state machine.
2018-10-20 20:18:46 -05:00
Daniel Shahaf
6898f71016
Add a test.
...
Related to https://github.com/zsh-users/zsh-syntax-highlighting/issues/549#issuecomment-431628338 and to #556 .
2018-10-21 00:26:34 +00:00
Daniel Shahaf
df8b2fb867
tests: Fix a failing test.
...
Update the test point for f3410c5862 (#264 ),
which changed the highlighting of aliases to consider what they resolve to.
Now the test file has both ${aliases[alias1]} and ${functions[alias1]},
the expectation is 'alias', and passes; thus:
Fixes #588 .
2018-10-18 23:48:17 +00:00
Daniel Shahaf
9d6ecea21c
Fix a long-standing bug in a unit test. This uncovers a regression.
...
The test never actually defined a function named 'alias1', not even
when zsh 5.4 warned it about this (see 9523d6d49c ,
which was wrong and is hereby reverted).
The test that's now failing has been filed as issue #558 .
2018-10-18 23:45:38 +00:00
Matthew Martin
47c2b7e185
main: Distinguish quoted/unquoted command substitutions
...
Closes #547 .
2018-10-13 09:37:09 -05:00
Matthew Martin
d6586e2a4f
main: Order precommand_options and add '-'
...
Fixes #499 .
2018-10-10 23:23:35 -05:00
Matthew Martin
31276c1b64
main: Avoid empty character classes
...
Avoids an error in pre-5.0.8: bad pattern: -[]#
2018-10-10 23:02:33 -05:00
Matthew Martin
07f259f653
main: Avoid null elision in _check_path
...
This could be triggered if BUFFER='\'.
2018-10-10 22:30:53 -05:00
Matthew Martin
e27e53b1ef
main: Highlight unknown precommand option as unknown-token
2018-10-10 22:30:51 -05:00
Matthew Martin
c6e3d216ec
main: Consolidate TOKENS_COMMANDSEPARATOR handling
...
No functional change.
2018-10-10 22:26:49 -05:00
Matthew Martin
5bb5703b0d
main: Move TOKENS_CONTROL_FLOW handling into command word branch
...
No functional change.
2018-10-10 22:26:49 -05:00
Matthew Martin
dea05e44e6
main: Recognize more redirection and array assignment parse errors
...
() ) } are invalid as a redirection target.
() } are invalid in an array assignment.
2018-10-10 22:26:49 -05:00
Matthew Martin
2f03b6d704
main: Do not highlight a redirection target as an option
2018-10-10 22:26:49 -05:00
Matthew Martin
b075147888
main: Consolidate conditionals together.
...
No functional change.
2018-10-10 22:26:49 -05:00
Matthew Martin
9289a57de0
main: Remove already_assigned
2018-10-10 22:26:49 -05:00
Matthew Martin
c76daac095
main: Move start_pos=$end_pos to the beginning of the loop
...
This allows for use of continue.
2018-10-10 22:26:49 -05:00
Matthew Martin
de28e20fbc
main: Simplify this_word next_word updating
2018-10-10 22:26:49 -05:00
Matthew Martin
c05ebf762c
main: Do not recognize always as a reserved word in a redirection
2018-10-10 22:26:49 -05:00
Matthew Martin
ae5b9b2dc9
main: Set redirection style when recognizing the redirection
2018-10-10 22:26:49 -05:00
Matthew Martin
df431eeee8
main: Recognize repeat with the other reserved words
2018-10-10 22:26:49 -05:00
Matthew Martin
3ddb974a3d
main: Remove needless code
...
The below code handles this case.
2018-10-10 22:26:49 -05:00
Matthew Martin
b6e0aeb380
main: Use unknown-token when the token type is unknown
2018-10-10 22:26:49 -05:00
Matthew Martin
4748f9bd3d
main: Add alias tests
2018-10-10 22:26:47 -05:00
Matthew Martin
e3edddd8ec
main: alias style overrides precommand style
2018-10-10 22:20:19 -05:00
Matthew Martin
c138123397
main: Move alias handling up.
...
This will set style=alias before the great fork.
2018-10-10 22:20:19 -05:00
Matthew Martin
57386f30ae
main: Recursively expand aliases
2018-10-10 22:20:19 -05:00
Matthew Martin
e1ecf950e2
main: Do path expanstion after alias expansion
2018-10-10 22:20:19 -05:00
Matthew Martin
f46b148c52
main: Only expand aliases in command position
2018-10-10 22:20:19 -05:00
Matthew Martin
99d7235c2b
main: Add test for an alias to a redirection
2018-10-10 22:20:19 -05:00
Matthew Martin
05a55108c9
main: Expand aliases before looking for redirections
2018-10-10 22:20:19 -05:00
Daniel Shahaf and Matthew Martin
e43e4fd2c7
'main': Fix $flags_sans_argument for 'nice'.
...
Follow-up to 2c15b0e996 ("Learn $flags_sans_arguments…").
2018-10-10 22:20:19 -05:00
Daniel Shahaf and Matthew Martin
a56c33c3be
Bump copyright years.
2018-10-10 22:20:19 -05:00
Daniel Shahaf and Matthew Martin
005179ed8e
'main': Update $this_word state with our inferences.
...
Found by code inspection.
2018-10-10 22:20:19 -05:00
Daniel Shahaf and Matthew Martin
0709520597
No functional change.
...
Follow-up to 1fee620e62 .
2018-10-10 22:20:19 -05:00
Daniel Shahaf and Matthew Martin
f7ac43cd49
'main': Unify $ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS and $precommand_options.
2018-10-10 22:20:19 -05:00
Daniel Shahaf and Matthew Martin
31ceaed4f4
'main': Highlight array parameters in command position.
2018-10-10 22:20:18 -05:00
Daniel Shahaf and Matthew Martin
ad6261fbca
'main': Use a more robust way of testing for $parameters' availability.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
3a33ac1d20
'main': Break out a new helper function for readability.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
f3425e18fe
'main': Let _zsh_highlight_main__type return false on failure.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
82c39716eb
'main': Write the "remainder" of the sentence in a comment. No functional change.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
a2e993c59f
'main': Learn $flags_sans_arguments and use that to parse '-xy foo' correctly where -x takes no argument and -y does.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
bee115f797
'main': Correct a comment.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
7f5e11e38b
'main': Remove superfluous variable. No functional change.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
78be8f611f
'main': Highlight 'doas'.
...
Fixes #365 .
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
8b11ca087e
'main': Highlight 'nice'.
...
Fixes #168 .
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
5694221939
'main': Highlight the 'command' precommand.
...
Fixes #343 .
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
4c7db4e886
'main': Update state machine docs. No functional change.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
add2ac59fc
'main': Permit $flags_with_argument to be empty.
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
6e8984e2ec
'main': Make sudo handling more generic.
...
Part of issue #343 .
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
dbdebfaaa5
'main': Following up to the last commit, also highlight braced parameter expansions: «${foo}».
2018-10-10 22:19:41 -05:00
Daniel Shahaf and Matthew Martin
bf055f7df2
'main': Fix the last commit's issue concerning parameter expansion at command word.
2018-10-10 22:19:36 -05:00
Daniel Shahaf and Matthew Martin
76d61360a7
'main': New XFail test for parameter expansion at command word.
2018-10-09 23:28:54 -05:00
Daniel Shahaf and Matthew Martin
f3410c5862
'main': Expand aliases first. (Issue #264.)
...
This commit causes an alias to an invalid command to be highlighted as an error
(unknown-token).
2018-10-09 23:28:54 -05:00
MinJae Kwon and Daniel Shahaf
cf88b63523
docs: Remove superfluous indentations in code block
2018-10-07 14:57:42 +00:00
Daniel Shahaf and Matthew Martin
565463ca8f
'main': Add regression test for an unclosed backtick substitution
2018-09-30 16:26:01 -04:00
Matthew Martin
e86f75a840
main: Highlight {command,process} substitution delimiters
2018-09-30 16:26:01 -04:00
Matthew Martin
22839d08ef
main: Return 0 if braces_stack is empty
...
This allows a caller to know if the command or process substitution is
complete.
2018-09-30 15:32:21 -04:00
Matthew Martin
472c71c1fa
main: Support the glob_assign option
2018-09-30 15:32:21 -04:00
Matthew Martin
9616bfdb20
main: Ignore zsh 5.0.8 off by one bug in tests
2018-09-30 15:32:21 -04:00
Matthew Martin
8a93b852ca
main: Add test for command substitution in assignment
2018-09-30 15:32:21 -04:00
Matthew Martin
932eb380e2
main: Highlight the value of an assignment
2018-09-30 15:32:19 -04:00
Matthew Martin
c06e5e95dc
main: Correct array assignment check
2018-09-30 15:31:48 -04:00
Matthew Martin
12e01336f1
main: Start _highlight_argument at $1
...
No functional change.
2018-09-30 15:21:20 -04:00
Matthew Martin
13d332af95
main: Make _check_path's argument explicit
...
No functional change.
2018-09-30 15:21:20 -04:00
Matthew Martin
57e451b531
main: Add test for unclosed command substitution
2018-09-30 15:21:20 -04:00
Matthew Martin
49dbb05791
main: Add test for =( ) process substitution
2018-09-30 15:21:20 -04:00
Matthew Martin
c0e64fe131
main: Highlight =( ) process substitutions
2018-09-30 15:21:19 -04:00
Matthew Martin
73640b79ea
main: Change conditional to a switch
...
Prepares for next commit. No functional change.
2018-09-30 14:59:59 -04:00
Matthew Martin
beae08776a
main: Add test for embedded process substitution
2018-09-30 14:59:59 -04:00
Matthew Martin
08d4401fae
main: Highlight <( ) and >( ) process substitutions
...
Fixes #494
2018-09-30 14:59:57 -04:00
Matthew Martin
3ac7d1c785
main: Add test for nested backticks; summon Cthulhu
2018-09-30 14:59:38 -04:00
Matthew Martin
9db393309e
main: Recurse into backtick command substitutions
2018-09-30 14:59:36 -04:00
Matthew Martin
c40c72c386
main: Track if $buf has the end of $BUFFER
...
This will allow for correct path_prefix highlighting in backticks.
2018-09-30 14:59:04 -04:00
Matthew Martin
b75169597e
main: Highlight command substitutions
2018-09-30 14:58:08 -04:00
Matthew Martin
ce592bd5c7
main: Move highlighting to _main_paint
...
This allows for callees to prepend highlights before $reply after the
length of the feature (e.g. command substution) is known.
2018-09-30 14:57:21 -04:00
Matthew Martin
ead8f8a1fc
main: Split highlighting code into another function
...
This will allow for highlighting $( ) and similar.
2018-09-30 14:55:28 -04:00
Matthew Martin
81e89a8800
main: Reorder declarations for next commit
...
No functional change.
2018-09-30 14:35:52 -04:00
Matthew Martin
dbce7317c7
main: Add buf_offset variable
...
No functional change.
2018-09-30 14:35:52 -04:00
Matthew Martin
49cc5e25b8
main: Simplify interface to __stack_pop
2018-09-30 14:35:52 -04:00
Matthew Martin
b1eb0358fa
main: Move fallback calculation to a function
...
No functional change.
2018-09-30 14:35:52 -04:00
Matthew Martin
8a0ffe1c43
main: Allow for patterned fallbacks
2018-09-30 14:35:52 -04:00
Matthew Martin
2fd7fbc3c2
main: Do not skip over backslash floowed by space or tab
...
Fixes #539 .
2018-09-29 21:33:39 -04:00
Matthew Martin
1eedb23c65
main: Fix blacklist dirs check when there is more than one element
2018-09-24 07:09:08 -05:00
Julien Nicoulaud
3a7ddcda0b
#535 : locally enable BARE_GLOB_QUAL option when loading highlighters
2018-09-22 22:50:46 +02:00
Julien Nicoulaud
8348e2d2cc
Enable testing on zsh 5.5.x/5.6.x releases
2018-09-22 21:27:01 +02:00
Matthew Martin and GitHub
683321d862
Merge pull request #529 from wraeth/master
...
main: Probe dirs after blacklist
2018-09-22 12:47:47 -05:00
Adam Johnson and Daniel Shahaf
42d396d819
driver: Exclude yank-pop again ( #183 ).
2018-09-07 18:21:53 +00:00
Sam Jorna (wraeth)
47d6dac133
main-highlighter: Probe dirs after blacklist
...
Move tests on the highlight path until after the blacklist is checked so
that blacklisted paths are not tested. This should prevent hangs on dead
remote filesystems provided the path is blacklisted in
X_ZSH_HIGHLIGHT_DIRS_BLACKLIST.
Updated tests to 'default' highlight as the blacklist is now checked
before the path is tested.
Bug: https://github.com/zsh-users/zsh-syntax-highlighting/issues/528
2018-08-31 13:04:52 +10:00
Bengt Brodersen
db6cac391b
main: Add glob qualifier to work around zsh/macOS bug
...
zsh/macOS bug: http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=42891
2018-06-03 08:43:02 +02:00
Daniel Shahaf and GitHub
ee26d44de1
Merge pull request #517 from tbroadley/fix-typos
...
docs: Fix typos
2018-05-26 13:55:52 +00:00
Thomas Broadley
7d3ec45249
docs: fix typos
2018-05-26 09:39:25 -04:00
Daniel Shahaf
5b539663c0
Add a regression test for a problem seen during development.
...
The «=(<foo)» construct was highlighted in blue (globbing?) from the '>' to the ')'.
2018-05-12 00:04:19 +00:00
Julien Nicoulaud
02a37dd919
CI: install packages required by test suite
2018-04-11 22:19:49 +02:00
Julien Nicoulaud
02b839550f
CI: add zsh 5.5
2018-04-11 22:00:50 +02:00
Matthew Martin
e4fffa4de5
main: Correct dollar-quoted-argument-unclosed fallback typo
2018-03-16 17:18:31 -05:00
Matthew Martin
5e9b7c4650
main: Add test for previous
2018-03-10 10:25:18 -06:00
Matthew Martin
d2c8f3a56d
main: Fix end of buffer check for path_prefix with non-null PREBUFFER
2018-03-10 10:25:18 -06:00
Matthew Martin
2c0c75a8ee
driver, main: Add -z to autoload calls
2018-03-06 11:35:40 -06:00
Matthew Martin
15e288a25c
main: Mark ZSH_HIGHLIGHT_DIRS_BLACKLIST experimental
2018-02-17 20:29:30 -06:00
Matthew Martin
6713727742
main: Add ZSH_HIGHLIGHT_DIRS_BLACKLIST
...
Closes #379 .
2018-02-17 20:29:30 -06:00
Matthew Martin
90b09f88ee
main: Move - to end of character class
...
Closes #472
2018-02-11 11:10:09 -06:00
Matthew Martin
9706af4b81
main: Simplify for next commit; no functional change
2018-02-11 11:10:08 -06:00
Matthew Martin
be26017e39
regexp: Add test for subexpression match
...
Closes #497
2018-02-11 09:58:00 -06:00
Matthew Martin
a9be0975c8
tests: Directly diff expected_region_highlight against region_highlight
2018-02-10 14:49:07 -06:00
Matthew Martin
622358f32d
main: Test suffix aliases if zsh/parameter is available
2018-02-10 14:20:25 -06:00
Matthew Martin
fdca2ef714
main: Fix off by one errors in quote helper functions
2018-02-10 14:20:25 -06:00
Matthew Martin
e13074528f
main: Do not highlight for regions that end before the start of BUFFER
2018-02-10 14:20:25 -06:00
Matthew Martin
ff85c7e01b
driver: Do not highlight newlines or past BUFFER for zle standout
2018-02-10 13:24:49 -06:00
Matthew Martin
84f0507cf6
driver: Replace eval with ${(P)
2018-02-10 13:24:49 -06:00
Matthew Martin
cc662371b1
main: Update test for issue #501 XFAIL
2018-02-10 13:23:42 -06:00
Matthew Martin
7b417be1ce
tests: Escape newlines in TAP description
2018-02-10 13:23:08 -06:00
Matthew Martin
1f1e629290
regexp: Add missing local for arrays match mbegin mend
...
See #497 .
2018-01-22 21:42:14 -06:00
Daniel Shahaf and Daniel Shahaf
03692831ad
'main': Don't highlight bare '$foo' as a filename, as it's a parameter expansion.
...
Fixes #474 .
2018-01-21 06:55:31 +00:00
Matthew Martin
382be9096d
main: Add XFAIL to redirections2 for process-substitution #494
2018-01-20 20:32:34 -06:00
Daniel Shahaf
8046c33b54
'main': Do not expand special parameters. Fixes #489 .
...
Adding «(e)» to the first subscript is a no-op: the subscript is known
to be safe due to the previous line.
2018-01-20 00:36:16 +00:00
Matthew Martin
f16e858f0c
main: Highlight backticks in double quotes
2018-01-19 18:19:07 -06:00
Matthew Martin
8d2955f51a
main: Consolidate } handling
...
No functional change.
2018-01-19 18:19:07 -06:00
Matthew Martin
18e214ee5b
main: Add test for quotes in options
2018-01-19 18:19:07 -06:00
Matthew Martin
6d133a0eb0
main: Highlight options as base_style
...
This means --foo="bar" will have quotes highlighted.
2018-01-19 18:19:07 -06:00
Matthew Martin
a65a07fae4
main: Correct typos
2018-01-19 08:00:25 -06:00
Matthew Martin
e48af35753
main: Only highlight characters special to globbing as globbing
2018-01-18 20:16:05 -06:00
Matthew Martin
604075aa90
main: Use =~ for globbing test
...
This will set MATCH as needed for the next commit
2018-01-18 20:08:14 -06:00
Matthew Martin
c1a048a084
main: Only highlight one base_style in _highlight_arguments
...
Closes #481
2018-01-18 19:37:41 -06:00
Matthew Martin
6835121eaf
main: Have helper functions return highlights in reply
...
This allows _highlight_arguments to put things in region_highlight prior
to the highlights decided by the helper functions, but decide on what
that prior highlight should be after the helpers have run.
2018-01-18 19:36:36 -06:00
Matthew Martin
6cc861fbad
main: Explicitly pass $style to _highlight_path_separators
2018-01-18 19:36:36 -06:00
Daniel Shahaf
0458b0c16f
'main': Don't match redirection operators in command substitutions as <-> number range globs. Fixes #483 .
2018-01-19 01:26:34 +00:00
Daniel Shahaf
901063aa0f
'main': Add a regression test for issue #483 , concerning «: $(<foo)».
2018-01-15 22:31:59 +00:00
Daniel Shahaf
f064b17d25
'main': Add an explicit test for escaped single quotes within single quotes, «'foo'\''bar'».
2018-01-13 15:45:41 +00:00
Daniel Shahaf
4724837df0
docs: main: Clarify back-quoted-argument, back-double-quoted-argument, back-dollar-quoted-argument, and assign.
...
Fixes #480 .
2018-01-13 14:43:37 +00:00
Daniel Shahaf
d39f83509e
docs: main: Add missing hyphens.
2018-01-13 14:43:02 +00:00
Daniel Shahaf
c969a1f26a
tests: Include the filename in error messages.
...
The new failure mode is:
.
Running test main
Bail out! On './highlighters/main/test-data/glob.zsh': Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank
Bail out! On './highlighters/main/test-data/glob.zsh': output on stderr
Running test pattern
Fixes #478 .
2018-01-12 14:28:08 +00:00
Matthew Martin
d17417ec1b
main: Highlight unclosed backtick subshells
2018-01-07 23:18:25 -06:00
Daniel Shahaf
987b743646
'main': Fix highlighting of «<->»-style numeric globs.
...
Found-by: Matthew Martin
2018-01-08 05:13:52 +00:00
Matthew Martin
df0f448586
main: Highlight path after globbing checks
...
Closes #468 .
2018-01-05 00:04:17 -06:00
Daniel Shahaf
2181247ae1
'main': Add a regression test for issue #474 .
2018-01-01 05:05:10 +00:00
Daniel Shahaf
0bf9ce7ab5
Happy New Year 2017.
2018-01-01 04:15:28 +00:00
Daniel Shahaf
8652a8f4e4
Bump copyright years.
2017-12-25 08:42:30 +00:00
Matthew Martin
bdbe214453
main: Add *-quoted-argument-unclosed styles
...
Closes #277 .
2017-12-24 00:03:55 -06:00
Daniel Shahaf
ff61a496b5
'main': Add a regression test for issue #468 .
2017-12-23 23:04:32 +00:00
Matthew Martin
572ca51b1f
main: Add tests
2017-12-23 14:45:49 -06:00
Matthew Martin
dc1b2f6fa4
main: Highlight partially quoted arguments correctly
...
Closes #130
2017-12-23 14:45:49 -06:00
Matthew Martin
25ae1c0121
main: Add ' helper function
2017-12-23 14:45:47 -06:00
Matthew Martin
dcb115c74c
main: Make " and $' helper functions responsible for highlighting quote
2017-12-20 15:52:03 -06:00
Matthew Martin
f623b07fb0
main: Remove trailing whitespace
2017-12-20 15:52:03 -06:00
Matthew Martin
ab1013ae0d
main: A redirection token is an invalid redirection target
...
Closes #466 .
2017-12-19 23:01:42 -06:00
Matthew Martin
eeb2eadcdd
docs: Fix links; thanks @dukex for noticing
...
Closes #441 .
2017-12-19 16:05:02 -06:00
Matthew Martin
b07ada1255
driver: Run under emulate -L zsh and add zsyh_user_options
2017-12-16 09:33:51 -06:00
Matthew Martin
3e56294543
tests: Avoid using new zmodload flags
...
Unbreaks build on pre-5.4.
2017-12-14 20:58:32 -06:00
Matthew Martin
2919679ee8
tests: Skip when zsh/pcre is not available
2017-12-14 20:44:54 -06:00
Daniel Shahaf
ce1be4153d
'main': Add tests for «ls \~» and for not performing parameter expansion on the command word.
...
This is a followup to the last commit, which was about issue #328 .
These tests are taken from the original #328 pull request, with updated
expectations where applicable.
Review-by: Matthew Martin
2017-12-15 02:35:10 +00:00
Matthew Martin
2411195c20
main: Expand paths before removing quoting
...
Fixes highlighting of `ls \~`. Closes #328 .
2017-12-12 07:58:35 -06:00
Matthew Martin
6a6d40208c
main: Add fallback for useroptions if zsh/parameter is absent
2017-12-11 07:26:54 -06:00
disarmer mk and Matthew Martin
4e6f60063f
Add regexp highlighter
2017-12-09 16:17:22 -06:00
Daniel Shahaf
fb948f5331
noop: Add comments.
2017-12-07 03:06:56 +00:00
Daniel Shahaf
1ad5c1f40f
Followup to parents: Restore sudo-* tests on platforms that don't have sudo.
...
Travis (as currently configured) is one such platform.
2017-12-07 01:16:02 +00:00
Daniel Shahaf
8d37377644
Followup to last: Don't require 'sudo' to test prefix redirections.
2017-12-07 01:04:13 +00:00
Matthew Martin
d04c62a224
tests: Add skips for tests that require sudo
2017-12-06 18:34:56 -06:00
Daniel Shahaf
26a82113b0
'main': Highlight 'sudo' correctly when it's not installed.
...
No test because _zsh_highlight_main__type() falls back to 'type -w' which runs
'rehash' implicitly, so on systems where 'sudo' is installed it's not possible
to simulate its being absent.
Test by forcing _zsh_highlight_main__type() to return 'none' when the
argument is [[ $1 == 'sudo' ]], and: (1) Run 'make test' and confirm
that all tests either pass, or fail and the first test point that fails
is one that expects "sudo" at command position to be highlighted as
'command'; (2) In an interactive zsh, 'sudo' at command position is
highlighted as an error.
2017-12-07 00:00:13 +00:00
Daniel Shahaf
c13ee4cf88
docs: Point to repology for finding packages.
2017-12-06 22:32:31 +00:00
Daniel Shahaf
918aa3eb88
README: Fix typo.
...
Closes #458 .
2017-11-29 17:15:27 +00:00
zapashcanon
f6d45cc191
Typo
2017-11-29 17:53:23 +01:00
Matthew Martin
ecdda36ef5
brackets: Ignore quotes
...
Closes #112 . Closes #138 .
2017-11-24 16:39:31 -06:00
Matthew Martin
7177ba005f
main: Split declaration and assignment
...
Unbreak build for 5.0.8 and earlier.
2017-11-24 16:35:25 -06:00
Matthew Martin
2a50614579
main: Save user options in a single variable
2017-11-24 16:07:44 -06:00
Matthew Martin
749b30221d
'main': Skip tests that break on msys2
...
Closes #382 .
2017-11-06 07:11:55 -06:00
Matthew Martin
f4d37b74cc
tests: Add ability to skip tests
2017-11-06 07:08:53 -06:00
Matthew Martin
4bd30737dc
tests: Support SKIP directive in tap-colorizer
2017-11-06 07:08:21 -06:00
Matthew Martin
038409c10d
tests: Run tests with WARN_CREATE_GLOBAL
2017-11-05 15:04:49 -06:00
Matthew Martin
c948a3caa0
tests: Declare local variables
2017-11-05 12:23:42 -06:00
Daniel Shahaf
e4352f98bb
driver: Revert previous commit, unbreaking the build on zsh<5.0.8.
2017-11-05 15:58:58 +00:00
Daniel Shahaf
9d9e9662cf
driver: Correctly escape assoc key pattern
2017-11-05 14:38:05 +00:00
Matthew Martin
18517cc98e
tests: Run tests with NOUNSET
2017-11-05 08:06:45 -06:00
Matthew Martin
459c128f43
tests: Set ZLE variables to sane defaults
2017-11-05 08:06:45 -06:00
Matthew Martin
079ea39f74
tests: Ensure region highlight is unset if NONE is expected
2017-11-05 08:06:45 -06:00
Matthew Martin
a9ce931439
Default possibly unset variables to empty
2017-11-04 20:26:07 -05:00
Matthew Martin
a33c72e838
tests: Use idiomatic set check
2017-11-02 20:08:28 -05:00
Matthew Martin
1f77ed8369
brackets: Use idiomatic set check
2017-11-02 20:08:28 -05:00
Matthew Martin
9dcfacc4a5
brackets: Disallow negative nesting level
2017-11-02 20:08:28 -05:00
Matthew Martin
ac90970edc
brackets: Don't call _zsh_highlight_add_highlight with empty style
2017-11-02 20:08:28 -05:00
Matthew Martin
f547f7768c
brackets: Add test for highlighting errors with no styles
2017-11-02 20:08:28 -05:00
Daniel Shahaf
a2a899b41b
driver: _zsh_highlight_bind_widgets: Be resilient to NO_UNSET being set in the calling scope.
...
Fixes #449 .
2017-11-02 17:07:10 +00:00
Daniel Shahaf
c41356c3f6
docs: Add Void Linux link.
2017-10-18 00:17:29 +00:00
Julien Nicoulaud
8146d58bb2
CI: customize IRC notifcation message
2017-09-28 19:07:24 +02:00
Daniel Shahaf
5436d3e5fc
tests: Remove superfluous comment.
...
The functions can remain defined because, nowadays, the test harness
runs each test in a subshell; but that's a well-known property of the
test harness so need not be mentioned explicitly.
Inspired by discussion on issue #443 .
2017-09-11 18:45:35 +00:00
Julien Nicoulaud
3d26cb8146
tests: run the most recent versions first
2017-09-11 19:29:58 +02:00
Julien Nicoulaud
873b9955c7
tests: add zsh 5.4.2
2017-09-11 19:27:52 +02:00
Daniel Shahaf
4cde79ef00
release.md: Make a little more copy-pasteable.
2017-08-30 07:32:56 +00:00
Daniel Shahaf
9ff91eb8f0
Post-release version number bump.
2017-08-29 06:05:57 +00:00
Daniel Shahaf
434af7b11d
Tag version 0.6.0.
2017-08-29 06:04:59 +00:00
Julien Nicoulaud
6f149dfc5e
Tests: add zsh 5.4 and 5.4.1
2017-08-10 20:26:11 +02:00
Daniel Shahaf
e58800158a
#440 : Identify the output.
...
Useful when using, e.g., Debian's package, which outputs just "Debian" here.
2017-08-09 18:42:35 +00:00
Julien Nicoulaud
871041a939
#440 : Make sure zsh's git hash is printed when testing against zsh master branch
...
Context: zsh-users/zsh-docker#2
2017-08-01 18:31:18 +02:00
Julien Nicoulaud
ed90f0d2c9
#440 : Fix minimum required Zsh version (4.3.11 instead of 4.3.17)
2017-08-01 17:55:23 +02:00
Julien Nicoulaud
bbaae63f2e
#440 : Test on Zsh master and intermediate releases since 4.3.11
2017-08-01 17:55:23 +02:00
Daniel Shahaf
d025148858
#440 : docs: Remove the travis links from README during 'make install'.
2017-07-31 23:16:37 +00:00
Daniel Shahaf
f60d9b8c36
#440 : Make README more readable in source form.
2017-07-31 23:10:53 +00:00
Julien Nicoulaud
d43fe3ab70
#440 : Setup IRC/gitter notifications
2017-08-01 00:56:30 +02:00
Julien Nicoulaud
47ac611c89
#440 : Add build status badge
2017-08-01 00:56:30 +02:00
Julien Nicoulaud
46441b1c0d
#440 : Print zsh version before tests
2017-08-01 00:56:30 +02:00
Julien Nicoulaud
7e840ff2db
#440 : Fix Travis-CI configuration
2017-08-01 00:56:30 +02:00
Julien Nicoulaud
176a019434
#440 : Add Travis-CI configuration
2017-08-01 00:56:30 +02:00
Daniel Shahaf
e4ed76b87d
release.md: Correct 'git push' instructions.
2017-07-31 17:42:28 +00:00
Daniel Shahaf
30a29a9e31
Post-release version number bump.
2017-07-31 17:39:45 +00:00
Daniel Shahaf
dc26731555
Tag version 0.6.0-rc1.
2017-07-31 17:31:25 +00:00
Daniel Shahaf
411864d35b
release.md: Create annotated tags, fix markup.
2017-07-31 17:30:59 +00:00
Daniel Shahaf
d1666463a7
changelog: Update through dea1fedc73.
2017-07-31 17:22:41 +00:00
Julien Nicoulaud
dea1fedc73
#419 : Add links to OpenSUSE build service deb/rpm repositories
2017-07-31 19:12:40 +02:00
Daniel Shahaf
b56ee542d6
Merge remote-tracking branch 'upstream/pr/433'
...
Note that there will be no zsh 5.3.2; zsh 5.3.1 will be followed
by 5.4. There might be 5.4-test-1 pre-releases, though.
* upstream/pr/433:
driver: Improve comment about ^r pattern match bug
driver: Adjust zsh version for probing for pattern match bug
README: Fix FAQ entry about isearch highlighting
2017-07-30 17:11:33 +00:00
m0viefreak
3c43da5ffe
driver: Improve comment about ^r pattern match bug
...
The bug is not specific to 5.3.1.
2017-07-30 19:08:21 +02:00
m0viefreak
f2ba507bbc
driver: Adjust zsh version for probing for pattern match bug
2017-07-30 19:08:21 +02:00
m0viefreak
28e661bbc8
README: Fix FAQ entry about isearch highlighting
...
Fixes #423
2017-07-30 19:08:18 +02:00
Daniel Shahaf
39a6c476dd
changelog: Update through 5feed23962.
2017-07-30 16:38:30 +00:00
Daniel Shahaf
5feed23962
docs: Unbreak Fedora link.
...
Fixes #439 .
2017-07-28 11:30:31 +00:00
jsoizo and Daniel Shahaf
ad522a0914
driver: Fix printing error message to file when cannot resolve highlighters directory location
...
Fixes #426 .
Review-by: Matthew Martin, me
2017-04-09 16:47:42 +00:00
Daniel Shahaf
462779629a
driver: Workaround pattern isearch bug in zsh ≤ 5.3.1, already fixed upstream.
...
Merge remote-tracking branch 'upstream/pr/415'
* upstream/pr/415:
workaround for PAT_STATIC bug in zsh
2017-03-29 09:18:59 +00:00
Daniel Shahaf
73cb832702
'main': Highlight mismatched 'if'/'fi'.
...
Also 'then'/'elif'/'else'.
2017-03-05 17:33:36 +00:00
Daniel Shahaf
be083d7f37
driver: Improve «unhandled ZLE widget 'foo'» error message.
...
Fixes #409 .
2017-03-05 14:38:52 +00:00
Daniel Shahaf
237f89ad62
'main': Don't consider «$*» a glob.
2017-02-11 23:49:13 +00:00
Christian Höltje
835fec7f3c
workaround for PAT_STATIC bug in zsh
...
ZSH versions less than 5.3.2 (or 5.4) have a bug that prevents
`history-incremental-pattern-search-backward` for working
correctly (the history stops searching after the first found item).
Closes #407
2017-02-09 17:58:36 -05:00
Daniel Shahaf
9523d6d49c
tests: zsh 5.4-to-be compatibility: Set a new "I am shooting myself in the foot" option.
2017-01-25 19:35:34 +00:00
vinter and Daniel Shahaf
aac4a44238
driver: Fix duplicated slash in error message
...
Fixes #400 .
2016-12-16 10:20:04 +00:00
Giridaran Manivannan and Daniel Shahaf
4f49c4a35f
docs: Update zplug install instruction
...
The latest version of zplug has deprecated the `nice` tag. The `defer` tag is the preferred method now.
2016-12-15 07:47:58 +00:00
Daniel Shahaf
b8fa1b9dc9
driver: Handle aliases that begin with a '+'
...
Merge remote-tracking branch 'upstream/pr/395'
* upstream/pr/395:
tests: Add a regression test for issue #392 (aliases beginning with a '+' are lost).
tests: Move some code in preparation for next commit. No functional change.
driver: Don't undefine aliases that begin with a '+', to workaround an upstream bug.
2016-12-03 13:55:52 +00:00
Daniel Shahaf
5efd062a4d
tests: Add a regression test for issue #392 (aliases beginning with a '+' are lost).
2016-12-03 13:54:47 +00:00
Daniel Shahaf
67be62107b
tests: Move some code in preparation for next commit. No functional change.
2016-12-03 13:54:47 +00:00
Daniel Shahaf
74949c2d91
driver: Don't undefine aliases that begin with a '+', to workaround an upstream bug.
...
Fixes #392 .
2016-12-03 13:54:47 +00:00
Daniel Shahaf
8d5afe47f7
driver: Be immune to 'alias' having been redefined.
2016-12-01 09:06:32 +00:00
Daniel Shahaf
76ea9e1df3
'main': Highlight possible history expansions in double-quoted strings.
2016-11-22 07:09:29 +00:00
Daniel Shahaf
50fbb5f76e
docs: Update Homebrew link.
...
The upstream repository has been split and renamed.
Fixes #391 .
2016-11-20 05:39:17 +00:00
Daniel Shahaf
2dce602727
driver: Be immune to weird aliases in the calling scope.
...
Fixes #390 .
2016-11-11 08:35:19 +00:00
Daniel Shahaf
9396ad5c5f
'main': Fix highlighting of comments followed by non-comments (on a subsequent line).
...
Merge remote-tracking branch 'upstream/pr/385'
* upstream/pr/385:
'main': Add regression test for previous commit.
'main': Fix bug: no start_pos=$end_pos in comment short path
Fixes #385 .
2016-11-02 15:54:56 +00:00
Daniel Shahaf
347cf0eb06
'main': Add regression test for previous commit.
2016-11-02 15:54:02 +00:00
Sebastian Gniazdowski
5625e30b87
'main': Fix bug: no start_pos=$end_pos in comment short path
2016-11-02 10:58:15 +01:00
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.
2016-11-02 03:16:45 +00:00
Daniel Shahaf
626c034c68
Add FreeBSD port
2016-10-29 16:55:32 +00:00
Michael Kuhn
3d74aa47e4
Add Fedora package
2016-10-27 21:29:55 +02:00
Daniel Shahaf
5398949cb3
changelog: Update for changes pulled out of 0.5.x.
2016-10-24 11:33:40 +00:00
Daniel Shahaf
035d3eb095
Follow-up to 28d7056a7a: Fix test expectations.
2016-10-22 17:46:42 +00:00
Daniel Shahaf
b7e277106b
README: Set alt="" attributes.
2016-10-20 01:04:41 +00:00
Daniel Shahaf
1495195eb5
README: Add a third image.
...
Also remove the existing image, thereby removing the filename expansion
example and the file-existence highlighting example.
2016-10-20 01:02:27 +00:00
Daniel Shahaf
50cbdbaebc
README: Add another image.
2016-10-20 00:46:22 +00:00
Daniel Shahaf
242481c279
README: Use a more minimal example iamge.
2016-10-20 00:15:31 +00:00
Daniel Shahaf
cd9ec14a65
README: Add before/after images
2016-10-20 00:03:09 +00:00
Daniel Shahaf
24096c2e4f
changelog: Update through 28d7056a7a.
2016-10-20 00:00:58 +00:00
Daniel Shahaf
28d7056a7a
'main': Escape '!' within double-quoted strings.
2016-10-19 23:56:25 +00:00
Daniel Shahaf
1bdb88aee1
Post-branch version number bump.
2016-10-19 23:08:18 +00:00
Daniel Shahaf
d464d3857f
changelog: Write arg0 entry.
2016-10-19 09:10:24 +00:00
Daniel Shahaf
f5c44ed7a2
changelog: Markup tweak.
2016-10-18 23:59:32 +00:00
Daniel Shahaf
2335986a39
changelog: Add the last few entries. One remains as a TODO.
2016-10-18 23:54:52 +00:00
Daniel Shahaf
e060a0a1c8
release.md: Record the specific command I used.
2016-10-18 22:53:17 +00:00
Daniel Shahaf
f3d0e141fd
changelog: Review.
2016-10-18 22:53:17 +00:00
Daniel Shahaf
3c90a673f6
changelog: Update through 0020f592c1.
2016-10-18 22:53:17 +00:00
Daniel Shahaf
773d60c833
changelog: Update through d37c55c788.
2016-10-18 22:53:17 +00:00
Daniel Shahaf
2dff6e54ed
changelog: Copyedit.
...
- Move an entry to another section.
- Fix commit hash width.
- Add missing punctuation.
2016-10-18 22:52:36 +00:00
Daniel Shahaf
0020f592c1
changelog: Update through cef49752fd.
2016-10-18 02:28:40 +00:00
Daniel Shahaf
56e4c38ab4
changelog: Start 0.5.0 section. Update through bc7f8ea433.
2016-10-18 02:28:39 +00:00
Daniel Shahaf
7d38d07255
'main': Followup to fdaeec4514: Update comment.
...
That revision was itself a followup to 51614ca2c9 .
2016-10-17 20:46:46 +00:00
Daniel Shahaf
094329eb14
'main': Introduce style fallback for the command word.
...
Fixes #316 .
* danielsh/i316-v2:
'main': Enable fallback to the 'arg0' style.
'main': Set fallback style for the 'arg0' style.
2016-09-28 13:25:05 +00:00
Daniel Shahaf
bccc3dc269
'main': Enable fallback to the 'arg0' style.
2016-09-28 13:22:29 +00:00
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'.
2016-09-28 13:22:09 +00:00
Daniel Shahaf
2b303f01b6
dev tools: Automagically handle newlines (\n) in $BUFFER.
2016-09-27 22:55:16 +00:00
Daniel Shahaf
79198759b3
tests: Also test arguments to an anonymous function.
2016-09-25 18:08:45 +00:00
Daniel Shahaf
dd51b7bebe
Merge remote-tracking branch 'upstream/pr/374' into HEAD
...
* upstream/pr/374:
'main': Directly count spaces to skip, don't leverage proc_buf length
2016-09-25 15:58:35 +00:00
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
2016-09-25 17:52:56 +02:00
Daniel Shahaf
44ef6e38e5
'main': Highlight several more special (non-alphabetic) parameters.
2016-09-25 14:51:02 +00:00
Daniel Shahaf
4afe670f7a
'main': Highlight shell's PID ($$) inside double quotes.
2016-09-25 14:40:58 +00:00
Daniel Shahaf
c3913e0d8e
'main': Highlight command substitutions inside double quotes.
...
Part of issue #139 .
2016-09-25 14:40:02 +00:00
Daniel Shahaf
4fc35362ee
'main': Permit subshells to end at command position.
...
Fixes #344 .
2016-09-25 12:06:39 +00:00
Daniel Shahaf
2bb8f0703d
'main': Highlight mismatched foreach/end.
...
Fixes #96 .
2016-09-25 11:52:15 +00:00
Daniel Shahaf
a2876fb57d
dev tools: Add a TODO to introduce code reuse.
2016-09-25 11:38:54 +00:00
Daniel Shahaf
b2733a64da
'main': Highlight mismatched do/done.
2016-09-25 11:38:54 +00:00
Daniel Shahaf
2755438e80
'main': Yet another test for mismatched braces.
2016-09-25 11:38:52 +00:00
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.
2016-09-25 12:35:28 +02:00
Daniel Shahaf
a053768627
dev tools: Remove a superfluous empty line.
2016-09-25 08:11:01 +00:00
Daniel Shahaf
e5782e4ddf
'main': Highlight 'always' blocks.
...
Fixes #335 .
2016-09-25 08:11:01 +00:00
Daniel Shahaf
8bf423d16d
'main': Don't find command positions within multiline array literals.
...
Fixes #333 .
2016-09-24 17:55:18 +00:00
Daniel Shahaf
5627fd2045
dev tools: Stage the copyright block to make diffs smaller.
2016-09-24 17:07:01 +00:00
Daniel Shahaf
987c133486
dev tools: Tolerate invalid input.
2016-09-24 17:06:21 +00:00
Daniel Shahaf
a4196eda5e
'main': Restore compatibility with zsh-4.3.14 and older (after e3182c18de8f).
...
Fixes #368 .
2016-09-23 15:55:06 +00:00
Daniel Shahaf
e15a09840e
dev tools: Automate a recurring step: Set year correctly for new tests.
2016-09-23 06:37:28 +00:00
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 .
2016-09-23 06:37:26 +00:00
Daniel Shahaf
2fabf7ca64
'main': More tests for mismstached parentheses and braces.
2016-09-22 11:12:42 +00:00
Daniel Shahaf
51b9d79c3b
'main': Highlight mismatched parentheses and braces.
2016-09-22 11:12:42 +00:00
Daniel Shahaf
0a9b347483
driver: Warn just once when a highlighter is missing.
...
The heretofore code warned once per keypress.
2016-09-22 04:10:28 +00:00
Daniel Shahaf
02807f1826
'main': Support the IGNORE_BRACES option.
...
This is related to a future "unbalanced { ( ) }" check for issue #344 .
2016-09-22 03:45:04 +00:00
Daniel Shahaf
a8a6384356
'main': Add tests for the IGNORE_BRACES option.
...
Also adds an XFail test for balanced braces for issue #344 .
2016-09-22 03:41:53 +00:00
Daniel Shahaf
fdaeec4514
'main': Followup to 51614ca2c9: Run cheaper conditions first.
...
This was suggested on #355 .
2016-09-08 19:09:29 +00:00
m0viefreak
4c4baede51
'brackets': Don't highlight corresponding bracket on accept-line
2016-09-08 15:22:43 +02:00
Alyssa Ross and Daniel Shahaf
da60234fb2
driver: Declare global variables
...
This caused warnings with `setopt warn_create_global`.
2016-08-31 16:26:09 +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
m0viefreak and Daniel Shahaf
4ad311ec0a
driver: Enable highlighting during isearch under zsh≥5.3.
...
This patch causes a behaviour difference in the [i257] scenario:
- Before this change, the zle_highlight[isearch] is applied and z-sy-h's
highlighting isn't.
- With this change, both zle_highlight[isearch] and z-sy-h's
highlighting are applied, so «echo foo» renders the first word in green
underline (fg=green from ZSH_HIGHLIGHT_STYLES[builtin], underline from
zle_highlight[isearch]).
This patch causes the presuppositional FAQ entry added in
a8fe22d422 to be correct.
This is part of #261 , of which #288 was a spin-off.
[i257] https://github.com/zsh-users/zsh-syntax-highlighting/pull/257#issuecomment-168394665
2016-07-30 20:08:12 +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
m0viefreak and Daniel Shahaf
a8fe22d422
driver: Don't highlight in isearch
...
zsh version 5.2 and lower don't support ISEARCHMATCH_ACTIVE and
we are unable to re-apply zle_highlight on top. Therefore it is
impossible to see the underlined matched area.
Since that information is more important, completely disable
highlighting in isearch in that case.
To do that, we need to make sure we are actually called when
something changes in isearch.
Trumps #257 .
The FAQ entry presupposes #245 will be fixed (in time for the release) too.
2016-07-29 21:07:48 +00:00
m0viefreak and Daniel Shahaf
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 .
2016-07-29 20:41:06 +00:00
m0viefreak and Daniel Shahaf
9e569bb0fe
driver: Widget binding: Support binding incomplete/nonexistent widgets
2016-07-29 20:41:06 +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
m0viefreak and Daniel Shahaf
b9112aec79
driver: Widget binding: Use ${(k)widgets} instead of $(zle -la)
...
Avoids a fork.
2016-06-20 18:37:11 +00:00
m0viefreak and Daniel Shahaf
f3d3aaa00c
'main': Document _pathseparator styles
2016-06-12 09:06:30 +00:00
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.
2016-06-11 14:19:17 +02: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
Matthew Martin
91fa057a39
minor: 'main': Only search for prefixes if :h is a directory
2016-06-01 00:54:30 -05: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
m0viefreak and Daniel Shahaf
6cd39e7c70
'main': Highlight path separators
...
This commit is based on the work done by
Jorge Israel Peña (blaenk) in #136 .
Changes:
* Adjusted to changes on the latest master branch.
* Use regular path highlighter colors by default.
* Break out early if the separator color is the same to
improve performance.
* Tests.
2016-05-31 15:06:12 +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
m0viefreak
3b67e656bf
'main': Implement simple command type cache
2016-05-24 23:08:11 +02:00
m0viefreak
12b879caf7
'main': Use zsh/parameter instead of type -w
...
If possible, try to use the zsh/parameter module to get
information about a shell words.
This avoids subshells and is a huge speed improvement
on systems such as cygwin.
Note 1:
$commands does not know about PATH_DIRS. So in case
PATH_DIRS is set, 'type -w' is still used if nothing
else matches.
Note 2:
zsh/parameter can't distinguish between 'command' and
'hashed'. Adjusted the test for that case to XFAIL.
The ideal solution would be if whence had an option to
put the result in REPLY instead of printing it to stdout.
2016-05-13 20:25:07 +02:00
m0viefreak
61f43255ab
'main': Support multiple styles in _zsh_highlight_main_add_region_highlight
2016-05-13 20:25:04 +02: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
Matthew Martin
d37c55c788
minor: tests: Add comment for NONE in expected_region_highlight
2016-05-12 22:59:06 -05:00
Matthew Martin
364f206a54
docs: Give example of test that modifies its environment
2016-05-12 22:48:07 -05:00
Matthew Martin
19acd8e844
docs: Mention $BUFFER
2016-05-12 22:48:03 -05:00
Matthew Martin
13018f3dd7
docs: Document use of NONE in expected_region_highlight
2016-05-12 22:47:55 -05:00
Matthew Martin
0f43026bf0
docs: Document writing tests
2016-05-12 22:40:34 -05:00
Matthew Martin
1082067f93
tests: Fail on stderr output
...
Closes #291 .
2016-05-12 22:32:34 -05: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
m0viefreak and Daniel Shahaf
2f18ba64e3
'main': use zsh/parameter to resolve alias
...
If possible, use zsh/parameter to avoid forks.
Fixes #263 .
2016-05-13 02:27:03 +00:00
m0viefreak and Daniel Shahaf
3ce01076b5
driver: load zsh/parameter if available
2016-05-13 02:24:57 +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
Sebastian Gniazdowski and Daniel Shahaf
ef4bfe5bcc
'main': 2nd optimization that in my tests shows 2.2s -> 2.0s
2016-05-12 19:22:29 +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
Sebastian Gniazdowski and Daniel Shahaf
02229ebd63
'main': optimization that in my tests shows 2.7s -> 2.2s
...
Consider indexing long buffers (say 300 chars). E.g. following line:
integer offset=${${buf[start_pos+1,len]}[(i)$needle]}
will gradually go into large indices for first index [a,] and be kept
at large index for second index [,b]. Instead, we can remove already
processed characters from buf:
proc_buf="${proc_buf[offset + $#arg + 1,-1]}"
$offset and $#arg are small, first index will not be large. $proc_buf
will be smaller and smaller and the second index [,-1] will run shorter
and shorter.
2016-05-12 18:29:09 +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
m0viefreak
5fe8fd8bdc
'brackets': Fix for one-based indexing
...
Use correct indexing also for cursor-matchingbracket.
Fixup for 95d82568d8
2016-05-11 01:11:49 +02:00
Nils Luxton
2176692704
docs: Added style key prefix convention
...
Part of #306
2016-05-09 17:35:21 +01: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
Matthew Martin
9cab566f53
docs: Document installation with other plugin managers
...
Closes #297 .
2016-05-06 09:30:13 -05:00
Matthew Martin
bb341f186c
dev docs: Document testing quirks
2016-05-05 16:25:37 -05:00
Matthew Martin
b5955213b9
tests: Add tests for 'brackets' and 'pattern'
2016-05-05 15:36:33 -05: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
Matthew Martin
f73f3d53d3
'brackets': Allow unset ZSH_HIGHLIGHT_STYLES
...
Without this when bracket_color_size is 0,
$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
errors with division by zero.
2016-05-05 13:56:09 -05:00
Matthew Martin
eaa4335c34
tests: Set ZSH_HIGHLIGHT_STYLES=() during tests
...
Since the _zsh_highlight_add_highlight that the tests use ignores
ZSH_HIGHLIGHT_STYLES, we can test both an injective mapping and an empty
mapping at once.
2016-05-05 12:31:52 -05:00
Matthew Martin
d3678ec7a8
tests: Remove unused_highlight
2016-05-05 12:28:43 -05:00
Matthew Martin
fd061b5730
tests: Test ZSH_HIGHLIGHT_STYLES keys directly
...
Closes #287 . Testing the keys directly removes the need for
unused_highlight which will be removed next.
2016-05-05 12:28:39 -05:00
Matthew Martin
ccaf6f48a1
brackets: Fix bug introduced in 95d8256
2016-05-05 09:59:26 -05:00
Matthew Martin
e05b8e88ad
'brackets': Check if brackets match on first pass
...
This removes the need for the typepos array.
2016-05-04 20:50:55 -05:00
Matthew Martin
95d82568d8
'brackets': Use one-based indexing
...
zsh arrays start at one, and this will make the next commit easier.
2016-05-04 20:50:55 -05:00
Matthew Martin
f4d3dcb42f
'brackets': Move highlight call outside conditional
2016-05-04 20:50:55 -05:00
Matthew Martin
fd84010252
'brackets': Lift local declarations from inside loops
2016-05-04 20:50:55 -05: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
Matthew Martin
4da9889d15
tests: Use 'NONE' to denote no highlighting
...
'none' is a valid highlighting type. Since by convention styles are all
lowercase, 'NONE' shouldn't conflict with anything.
Closes #289 .
2016-04-30 12:48:44 -05:00
Matthew Martin
c346f6eb6f
docs: highlighters should use _zsh_highlight_add_highlight
2016-04-29 21:52:41 -05:00
Daniel Shahaf
f34714b8ee
Bump copyright years.
2016-04-30 02:11:17 +00:00
Matthew Martin
341a3ae1f0
highlighters: Use _zsh_highlight_add_highlight
...
_zsh_highlight_add_highlight appends to region_highlight $1 $2 and the
next non-null parameter. If there is no non-null parameter, do nothing,
This is so that highlighters can add a style with fallbacks if the most
specific style is not defined. If none of the applicable styles are
defined, do the right thing and don't add an invalid entry to
region_highlight.
The pattern highlighter doesn't use this function as it'd need too large
of an API change.
2016-04-29 10:09:16 -05:00
Matthew Martin
089329660b
highlighters: Pass around the style key instead of the style itself
2016-04-29 09:53:05 -05:00
Matthew Martin
a830613467
tests: Specify the style key instead of the style itself
2016-04-29 09:51:13 -05: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
m0viefreak and Daniel Shahaf
38c8fbea2d
root-highlighter: use EUID instead of id -u command
...
No need to fork every time.
2016-04-23 06:43:01 +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
Adam Kruszewski and Daniel Shahaf
d4f8edc9f3
plugin.zsh: Convert from symlink to plain file
...
Fixes zsh-users/zsh-syntax-highlighting#292 (compatibility with zsh-5.1.1/msys2 on windows).
2016-04-17 04:48:30 +00:00
Daniel Shahaf
367929502f
release.md: Add a release checklist line item.
2016-04-05 05:49:18 +00:00
Matthew Martin
78290e043b
tests: Expect the correct style
2016-04-03 20:43:13 -05:00
Matthew Martin
31ac2b36a9
tests: Quote style in expected_region_highlight
2016-04-02 09:45:24 -05:00
Matthew Martin
bb8d325c0c
tests: Fix grep syntax
...
In basic regular expressions | is not a special character that spearates
branches, so use an extended regular expression.
2016-04-01 00:52:27 -05:00
m0viefreak
79e4d3d124
apply suffix and isearch zle_highlights on top
2016-03-28 18:24:29 +02: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
m0viefreak
4849ef3307
Refactor the application of zle_highlight settings
...
- Extract duplicated code into a new function.
This makes it easier to add support for other entries in the
future, that cannot be accessed in the current version of zsh
(isearch, suffix).
- Make decision logic more comprehensible.
- Respect deliberately empty entries in zle_highlight.
Don't force the default value when the user deliberately sets
an entry in zle_highlight to the empty string.
For example
zle_highligh(paste:)
to disable paste highlighting completely.
2016-03-13 16:29:00 +01: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
m0viefreak and Daniel Shahaf
487b122c48
widget binding: don't exclude widgets with identical function name
...
Skipping when $cur_widgets == user:$cur_widget was introduced
with 776453cb5b . However there
are cases where this is not just an 'already rebound' event, but
simply a normal widget whose function name happens to be identical
to its widget name.
Example:
expand-absolute-path is a widget whose function name is also
expand-absolute-path. No reason why this should be ignored.
Another example:
edit-command-line
2016-03-12 17:23:12 +00:00
Daniel Shahaf
7044c1986e
docs: use https:// instead of git://
2016-02-18 13:39:24 +00:00
Vishnu Ks
bdb23d1378
use https instead of git for url
2016-02-17 23:52:54 +05:30
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
Sebastian Gniazdowski
3cb58fd7d7
Optimization: -1 is extra computation of string length internally
...
./parse.zsh "zplugin.zsh" > out_norm.txt 106,17s user 7,84s system 98% cpu 1:55,85 total
./parse.zsh "zplugin.zsh" > out_opt.txt 51,91s user 7,44s system 99% cpu 59,912 total
% wc -l zplugin.zsh
3188 zplugin.zsh
2016-02-12 08:31:14 +01: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
Daniel Shahaf
936e2e9314
tests: Add another comment. No functional change.
2016-01-02 20:52:40 +00:00
m0viefreak
ed33d2cb13
widget binding: don't exclude widgets starting with '_'
...
Just because a widget starts with _ does not mean it should be
skipped when rebinding. The only reason widgets need to be skipped
is when their function name start with _zsh_highlight_widget*,
which is checked later.
Example:
_expand_alias (^Xa) needs to be wrapped.
The exclusion of _* was introduced in 186d80054a
to fix #65 , but it is not needed. The relevant exclusion of
_zsh_highlight_widget* is already enough due to the case statement.
2016-01-02 14:29:04 +01:00
Daniel Shahaf
268656d52b
tests: Add a comment. No functional change.
2016-01-01 16:35:00 +00:00
Daniel Shahaf
38c3ac8831
docs: Note that Debian package has migrated to (been added to) Debian stretch.
2015-12-16 22:22:00 +00:00
Daniel Shahaf
82f5eb17ec
docs: Note Debian package name.
...
The Debian package should propagate to the "testing" suite (stretch) in a few days.
2015-12-12 11:04:38 +00:00
Daniel Shahaf
4f3910cbba
Fix issue #248 : Highlight 'pkexec' as a precommand.
2015-12-04 23:40:30 +00:00
Daniel Shahaf
73ee7c1f6c
Fix part of issue #238 , "fd redirections at command word".
...
This fixes fd's specified by a (single) digit. The named fd syntax remains an XFail.
2015-11-29 03:16:01 +00:00
Daniel Shahaf
48ecd29180
tests: Add two XFail tests for issue #238 , "fd redirections at command word".
2015-11-29 03:15:55 +00:00
Daniel Shahaf
430cf55368
tests: Cover [default].
2015-11-29 02:56:07 +00:00
Daniel Shahaf
46cd970bc4
tests: Improve tests by using $unused_highlight.
...
The default for [redirection] is 'none', so it wasn't actually being tested.
2015-11-29 02:53:58 +00:00
Daniel Shahaf
09c4114eb9
command word: Do not attempt to interpret command separator tokens as anything else.
...
The important part of this change is removing the second conjunct from the
condition; the remainder of the change gives one example of when that matters.
2015-11-29 02:02:42 +00:00
Daniel Shahaf
cf685a3a27
changelog: Start 0.4.1 section.
...
Also fix an error in the title of the 0.4.0 section.
2015-11-29 02:00:51 +00:00
Daniel Shahaf
69b6c4e450
release.md: Clarify release procedure.
2015-11-27 23:24:22 +00:00
Daniel Shahaf
7338c54a25
Post-release version number bump.
2015-11-27 23:20:09 +00:00
Daniel Shahaf
2d792b03bb
Tag version 0.4.0.
2015-11-27 23:19:23 +00:00
Daniel Shahaf
eee130f81d
changelog: Update through HEAD ( 952a97dbc9).
2015-11-27 23:17:47 +00:00
Daniel Shahaf
952a97dbc9
docs: Tweaks to highlighters.md after recent refactoring branch.
...
Merge remote-tracking branch 'danielsh/docs-highlighters.d-landing-page-v3'
* danielsh/docs-highlighters.d-landing-page-v3:
docs: Restore (with changes) links removed in f5ca4b891b .
docs: Followup to the recent docs branch: clean up some internal cross-references.
docs: Clarify tagline summary of 'root' highlighter
docs: Minor clarification.
Fixes zsh-users/zsh-syntax-highlighting#242 .
2015-11-27 04:12:02 +00:00
Daniel Shahaf
1f1ad09e38
docs: Restore (with changes) links removed in f5ca4b891b.
...
The preceding commit, which made docs/highlighters.md and
highlighters/README.md distinct, allows reverting their removal.
2015-11-27 04:07:02 +00:00
Daniel Shahaf
eb3715a56a
docs: Followup to the recent docs branch: clean up some internal cross-references.
2015-11-27 04:07:02 +00:00
Daniel Shahaf
95330c691b
docs: Clarify tagline summary of 'root' highlighter
2015-11-27 04:07:02 +00:00
Daniel Shahaf
371f8183d6
docs: Minor clarification.
2015-11-27 04:06:15 +00:00
Daniel Shahaf
2e5481ab9a
docs; INSTALL.md: Make 'system-wide' section easier to read.
2015-11-26 18:09:43 +00:00
Daniel Shahaf
2ed2f1e3c4
docs: INSTALL.md: Streamling .zshrc installation instructions.
2015-11-26 18:07:41 +00:00
Daniel Shahaf
b8ced86853
docs: Minor clarifications.
2015-11-26 17:15:48 +00:00
Daniel Shahaf
84734ba950
versionstamp: Better $ZSH_HIGHLIGHT_REVISION reporting when running from git.
2015-11-25 03:55:20 +00:00
Daniel Shahaf
635a68f7b4
driver: Fix error message wording
2015-11-25 03:54:33 +00:00
Daniel Shahaf
438a94496f
docs: Grammar fix.
2015-11-24 07:43:03 +00:00
Daniel Shahaf
7ee350efcd
docs: Port new text to individual highlighters' documentation.
...
The new text is from the preceding two commits, 22123ab622 + ded1c8789b .
Fixes a broken link.
2015-11-24 07:39:44 +00:00
Daniel Shahaf
22123ab622
docs: Follow-up to last: Fix markup.
2015-11-24 07:36:10 +00:00
Daniel Shahaf
ded1c8789b
docs: Clarify highlighters documentation.
2015-11-24 07:32:18 +00:00
Daniel Shahaf
0b3183f6cb
docs: Split README.md into INSTALL.md.
...
Fixes zsh-users/zsh-syntax-highlighting#235 .
2015-11-24 07:13:35 +00:00
Matthew Martin
8e115052e9
docs: Fix broken symlinks
2015-11-24 00:40:09 -06:00
Daniel Shahaf
5b34c23cfa
Merge remote-tracking branch 'phy1729/doc-all'
...
* phy1729/doc-all:
Remove broken links
docs: Create all.md
docs: Move docs into docs/
docs: Remove duplicate 'How to activate it' sections
docs: Move highlighter headers down one level
2015-11-24 06:30:45 +00:00
Daniel Shahaf
c575f8f375
Merge remote-tracking branch 'danielsh/docs-copyedit-v1'
...
* danielsh/docs-copyedit-v1:
docs copyedit: minor: Spelling/punctuation fix.
docs copyedit: Rewrap to 80 columns, part 4.
docs copyedit: Rewrap to 80 columns, part 3.
docs copyedit: Rewrap to 80 columns, part 2.
docs copyedit: Clarify tagline.
docs copyedit: minor.
docs copyedit: Review toplevel and tests README.md files.
docs copyedit: Rewrap to 80 columns.
docs copyedit: Restyle bold-italic to fixed-width.
docs copyedit: Port 6d93ea07fd to the other highlighters' README's.
docs copyedit: Whitespace.
2015-11-24 06:30:30 +00:00
Matthew Martin
f5ca4b891b
Remove broken links
2015-11-24 00:27:21 -06:00
Matthew Martin
51f66ae851
docs: Create all.md
2015-11-24 00:22:26 -06:00
Matthew Martin
0ab450ae47
docs: Move docs into docs/
2015-11-24 00:09:21 -06:00
Matthew Martin
35e0b0ca69
docs: Remove duplicate 'How to activate it' sections
2015-11-24 00:09:21 -06:00
Matthew Martin
2dd6923c30
docs: Move highlighter headers down one level
2015-11-24 00:09:21 -06:00
Daniel Shahaf
6e99128987
docs copyedit: minor: Spelling/punctuation fix.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
bcc9db2784
docs copyedit: Rewrap to 80 columns, part 4.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
b989ae23d0
docs copyedit: Rewrap to 80 columns, part 3.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
3f163a2fd4
docs copyedit: Rewrap to 80 columns, part 2.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
3bedd8571e
docs copyedit: Clarify tagline.
...
Restore zsh URL removed a few commits ago.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
9ce97cd64d
docs copyedit: minor.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
49f7beecb5
docs copyedit: Review toplevel and tests README.md files.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
12097d55d1
docs copyedit: Rewrap to 80 columns.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
8ea392e361
docs copyedit: Restyle bold-italic to fixed-width.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
91e4a576fb
docs copyedit: Port 6d93ea07fd to the other highlighters' README's.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
6c033e62e9
docs copyedit: Whitespace.
2015-11-24 06:06:16 +00:00
Daniel Shahaf
e60737d320
'make perf': Unbreak by porting over 'make test' harness changes.
...
In particular, tests were relying on the harness to provide a sandbox working
directory, but the perf harness wasn't providing that.
2015-11-18 17:52:46 +00:00
Daniel Shahaf
17fbcad8ac
'main': Fix state check.
...
At this time, no user-visible consequences are known.
2015-11-18 16:37:38 +00:00
Daniel Shahaf
ea5186543d
changelog: Update through HEAD ( 1933de83be).
2015-11-18 06:21:54 +00:00
Daniel Shahaf
1933de83be
'make install': Remove +x permission from installed library and documntation files.
2015-11-18 02:14:03 +00:00
Daniel Shahaf
e2096f5c4e
'make install': Unbreak PREFIX=~/foo usage.
...
Change quoting to only quote the shell variable, not the make variable. This
allows the leading '~' to be unescaped for make's sh to expand.
Followup to b1619c0013 .
2015-11-18 01:49:30 +00:00
Daniel Shahaf
29fd6ec1de
Support the '|&', '&!', '&|' command separators.
2015-11-17 20:19:19 +00:00
Daniel Shahaf
3ed0f7f823
noop: Consolidate two identical conditionals.
2015-11-17 20:07:14 +00:00
Daniel Shahaf
2dbcb575e5
internal: Document the ':regular' state.
2015-11-17 19:40:58 +00:00
Daniel Shahaf
00de155063
docs: 'main': Improve styles documentation.
2015-11-17 18:41:14 +00:00
Daniel Shahaf
3bfd250cce
'make perf': Designate this target as '.PHONY'.
...
Patch-by: Matthew Martin
2015-11-17 17:50:14 +00:00
Daniel Shahaf
7d4252f5f5
minor: docs: Improve dollar-double-quoted-argument documentation.
2015-11-17 03:55:00 +00:00
Daniel Shahaf
21e5e26923
docs: Clarify 'create a new highlighter' documentation.
2015-11-17 03:22:14 +00:00
Daniel Shahaf
b1619c0013
Fix issue #219 : install documentation fully and properly.
...
- Install the top-level README.md, which wasn't installed before.
- Install docs to /usr/local/share/doc rather than /usr/local/share.
2015-11-17 02:45:00 +00:00
Daniel Shahaf
79b95c629e
Drop unnecessary shebang lines.
...
Done in c30301d474 and
c687bddea3 for other tests.
2015-11-17 02:04:23 +00:00
Daniel Shahaf
3669d69226
Fix copyright year.
2015-11-17 02:02:42 +00:00
Daniel Shahaf
4fcfb15913
Highlight parameter expansions that are a command word.
...
Fixes zsh-users/zsh-syntax-highlighting#101 .
2015-11-17 01:37:58 +00:00
Daniel Shahaf
bdc1449733
noop: Break out a helper function.
2015-11-17 01:37:12 +00:00
Daniel Shahaf
1397f1bae1
tests: Tweak the isolation wrapper for style and robustness.
...
Followup to c015339202 .
Suggested-by: Matthew Martin
2015-11-17 01:06:50 +00:00
Daniel Shahaf
8f19af6b31
driver: Tolerate KSH_ARRAYS being set in the calling context.
...
Fixes zsh-users/zsh-syntax-highlighting#162 .
2015-11-17 00:48:22 +00:00
Daniel Shahaf
6e3720f39d
dollar-double-quoted-argument: Support the syntax «"${foo}"». (Issue #186.)
2015-11-17 00:40:02 +00:00
Daniel Shahaf
28776371a0
tests: Add an XFail test for highlighting «"${foo}"». (Issue #186.)
2015-11-17 00:37:58 +00:00
Daniel Shahaf
4f0c293fde
cursor: Remove cursor highlighting when accepting a line.
...
Fixes zsh-users/zsh-syntax-highlighting#109 .
Similar to 59fbdda64c in the 'main' highlighter.
2015-11-17 00:05:06 +00:00
Daniel Shahaf
96ee5116b1
Fix issue #228 , "Support the PATH_DIRS option".
2015-11-16 23:14:48 +00:00
Daniel Shahaf
a636527f70
tests: Add an XFail test for issue #228 , "Support the PATH_DIRS option".
...
This builds upon the test harness auto-cleaned-up directories work (c01533920 ).
2015-11-16 23:04:11 +00:00
Daniel Shahaf
2b35ff1c15
minor: Rename a test file to a not-escape-needing name.
...
There's simply no reason to use such names, now that the filename is no longer
itself test data.
2015-11-16 22:57:47 +00:00
Daniel Shahaf
c015339202
tests: Provide an independent, auto-cleaned working directory to each test.
...
Fixes zsh-users/zsh-syntax-highlighting#182.
Prerequisite for testing issue #228 .
* tests/test-highlighting.zsh
(run_test): Move functionality to run_test_internal; make run_test be a wrapper
that handles creating and cleaning up the tempdir.
* tests/README.md: Document the new feature.
* "highlighters/main/test-data/path-space- .zsh"
* highlighters/main/test-data/path-tilde-named.zsh
* highlighters/main/test-data/path.zsh
Change test data to not depend on being run from the source directory.
2015-11-16 22:54:52 +00:00
Daniel Shahaf
b5d02a2f49
tests: Document test isolation, implemented some time ago.
2015-11-16 22:31:18 +00:00
Daniel Shahaf
e1078a8b4c
'make install': Allow setting $(SHARE_DIR).
2015-11-16 19:14:19 +00:00
Daniel Shahaf
3620ad951f
Add an XFail test for issue #231 , "Assignment terminating subshell flags closing parenthesis as an error".
2015-11-16 19:04:37 +00:00
Daniel Shahaf
b285c7b821
brackets: Highlight closing ')' of array assignments correctly. (Issue #226.)
...
Followup to c0dafd1d85 , which changed the highlight of
those ')'s from <nothing> to [reserved-word].
2015-11-16 18:44:44 +00:00
Daniel Shahaf
44e5323b53
changelog: Update through HEAD ( c0dafd1d85).
2015-10-30 19:07:30 +00:00
Daniel Shahaf
c0dafd1d85
brackets: Highlight the closing brackets of subshells and blocks. (Issue #226.)
2015-10-30 20:20:30 +02:00
Daniel Shahaf
28abb960de
noop: Follow-up to last: improve readability.
2015-10-30 20:14:03 +02:00
Daniel Shahaf
a59f442d2d
brackets: Highlight the closing brackets of arithmetic expansion. (Issue #226.)
2015-10-30 17:28:48 +00:00
Daniel Shahaf
8b4adbd991
Fix issue #222 , "command word after repeat".
2015-10-30 13:31:43 +00:00
Daniel Shahaf
6fbd2aa957
Add an XFail test for issue #222 , "command word after repeat".
2015-10-30 13:31:23 +00:00
Daniel Shahaf
9e178f9f39
subshells: Highlight the opening parenthesis correctly. (Issue #166.)
...
Followup to 0d1bfbcbfa .
2015-10-30 11:38:32 +02:00
Daniel Shahaf
5a38710564
subshells: Add an XFail test demonstrating that #166 is not yet fixed.
...
Reported-by: Antony Lee
2015-10-30 09:34:01 +00:00
Daniel Shahaf
d3deffbf46
minor: Fix WARN_CREATE_GLOBAL warnings issued by zsh 5.1.1-dev-0.
...
The following warnings are issued by zsh as of zsh-workers/37018 (commit
de9effbce601 to zsh itself):
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter match created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter mbegin created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter mend created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: numeric parameter parameter MBEGIN created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: numeric parameter parameter MEND created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: scalar parameter MATCH created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter match created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter mbegin created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter mend created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: numeric parameter parameter MBEGIN created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: numeric parameter parameter MEND created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: scalar parameter MATCH created globally in function _zsh_highlight_main_highlighter_highlight_string
2015-10-30 10:12:04 +02:00
Daniel Shahaf
8ab8c815ec
Fix syntax error with zsh-5.0.5-dev-1 and older.
...
zsh prior to workers/32609 (commit 9d47e8398d299e53ffe4e7ddf3731d2fedae9948)
does not support the (-n)-less «[[ $var ]]» syntax.
Fixes zsh-users/zsh-syntax-highlighting#225 .
2015-10-30 09:34:16 +02:00
Daniel Shahaf
afa6bb3882
states work: Extend state machine documentation.
2015-10-30 08:38:45 +02:00
Daniel Shahaf
1ac39b0af1
comments: Mark prematurely-terminated command as an error.
...
This is already done for commands prematurely terminated by ";".
2015-10-30 08:38:45 +02:00
Daniel Shahaf
693de99a90
comments: Fix issue #163 and #167 : Highlight comments.
2015-10-30 08:38:44 +02:00
Daniel Shahaf
e76f208cf8
comments: Add a PASSing test for the NO_INTERACTIVE_COMMENTS case.
2015-10-30 08:38:39 +02:00
Daniel Shahaf
e9ceb2017e
comments: Add XFail tests from issues #163 and #167 .
...
These tests are based on the patches contributed in those issues:
commit 9d9df4fe80 (upstream/pr/167)
Author: Miciah Masters <miciah.masters@gmail.com >
AuthorDate: Thu Apr 23 20:28:24 2015 -0400
Commit: Miciah Dashiel Butler Masters <mmasters@redhat.com >
CommitDate: Thu Apr 23 20:28:24 2015 -0400
Highlight comments
M highlighters/main/main-highlighter.zsh
A highlighters/main/test-data/comments.zsh
commit d94f1a037f (upstream/pr/163)
Author: sonnym <michaud.sonny@gmail.com >
AuthorDate: Fri Mar 6 18:27:57 2015 -0500
Commit: sonnym <michaud.sonny@gmail.com >
CommitDate: Fri Mar 6 21:16:27 2015 -0500
highlight comments when interactive_comments is on
M highlighters/main/main-highlighter.zsh
A highlighters/main/test-data/comment-embedded.zsh
A highlighters/main/test-data/comment-leading.zsh
Patch-by: sonnym <michaud.sonny@gmail.com >
Patch-by: Miciah Masters <miciah.masters@gmail.com >
(corrected and refreshed for harness changes by me)
2015-10-29 18:08:30 +02:00
Daniel Shahaf
2f05620b19
sudo: Flag an error when a required argument is missing.
2015-10-29 12:01:13 +00:00
Daniel Shahaf
9cb87473cc
sudo: Tweak state computations.
...
This causes the ':start:' state to be set in $next_word in iteration N-1,
rather than to only be added to $this_word in iteration N.
2015-10-29 12:01:13 +00:00
Daniel Shahaf
f49f3bf0c0
sudo: Extend tests.
2015-10-29 12:01:13 +00:00
Daniel Shahaf
a3047a9121
sudo: Highlight an empty sudo; as an error.
...
The word following 'sudo' was considered :regular:, although it isn't.
2015-10-29 12:01:13 +00:00
Daniel Shahaf
86e9249709
sudo/redirections: Fix remaining part of issue #221 , "sudo and redirection don't mix".
2015-10-29 12:01:13 +00:00
Daniel Shahaf
0d1bfbcbfa
Highlight subshells and anonymous functions correctly.
...
Fixes zsh-users/zsh-syntax-highlighting#166.
Fixes zsh-users/zsh-syntax-highlighting#194.
Builds upon the issue #207 work.
2015-10-29 12:01:13 +00:00
Daniel Shahaf
c216242b46
command word: Highlight more reserved words. Part of issue #207 .
2015-10-29 12:01:13 +00:00
Daniel Shahaf
2218e26bf8
command word: Highlight 'else' correctly. Part of issue #207 .
2015-10-29 12:01:13 +00:00
Daniel Shahaf
b397b12ac1
command word: Start fixing issue #207 , "Word following certain reserved words should be a command word".
2015-10-29 12:01:13 +00:00
Daniel Shahaf
87deac3062
command word: Add an XFail test for issue #207 .
2015-10-29 12:01:13 +00:00
Daniel Shahaf
01d7eeb3c7
Fix issue #205 , "';' after assignment is highlighted as unknown-token".
2015-10-29 12:01:13 +00:00
Daniel Shahaf
6d6fb8b03e
redirections: Document handling of redirections and possibly fix a latent bug.
...
The change of behaviour is triggered by test-data/sudo-redirection.zsh: the iteration
on "otheruser" sets $next_word to ":regular::sudo_opt::start::sudo_opt::start:" before
this patch, but to ":regular::sudo_opt::start:" after it (note the deduplication).
2015-10-29 12:01:13 +00:00
Daniel Shahaf
be006aded5
sudo/redirections: Fix part of issue #221 , "sudo and redirection don't mix".
2015-10-29 12:01:11 +00:00
Daniel Shahaf
c6355a31b7
Followup to last: re-fix issue #9 and add test for it.
...
The fix for issue #9 was accidentally broken by the penultimate commit.
Note that we don't care about aliases to ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR
entries, since the code deals with aliases at command position.
2015-10-29 12:01:11 +00:00
Daniel Shahaf
018bc45f21
Followup to last: tighten the fix and ask a question.
2015-10-29 12:01:11 +00:00
Daniel Shahaf
2c9f8c8c95
Fix issue #209 , "precommand modifiers at non-command-word position".
2015-10-29 12:01:11 +00:00
Daniel Shahaf
88cf98d9c4
states work: Documents the various states.
2015-10-29 12:01:11 +00:00
Daniel Shahaf
0aa6a5db78
states work: Convert $new_expression parsing.
2015-10-29 12:01:11 +00:00
Daniel Shahaf
10b1da64e6
states work: Convert sudo parsing.
2015-10-29 12:01:11 +00:00
Daniel Shahaf
80d692c400
command word: Add an XFail test for issue #194 , "Highlight anonymous functions".
2015-10-29 12:01:11 +00:00
Daniel Shahaf
e49251b6fa
sudo/redirections: Add two XFail tests for issue #221 , "sudo and redirection don't mix".
2015-10-29 12:01:09 +00:00
Daniel Shahaf
2080a441ac
minor: Remove redundant setting of $highlight_glob.
2015-10-28 09:58:13 +02:00
Daniel Shahaf
59fbdda64c
main: Refresh highlighting upon accept-* widgets (accept-line et al).
...
Use this to remove [path_prefix] highlighting during accept-* widgets.
This causes ": file.tx<CR>" to remove the underline from "file.tx", like
": file.tx<SPACE>" already does. (Assume 'file.txt' exists.)
2015-10-28 09:24:08 +02:00
Daniel Shahaf
7723edf4f5
Add an XFail test for accept-line semantics.
2015-10-28 08:30:05 +02:00
Daniel Shahaf
c808d2187a
wrapping: Don't add '--' when invoking widgets.
...
It's the widget's caller's responsibility, not ours, to add '--' where due. If
we do it, two instances of '--' might result. (I haven't been able to provoke
this problem.)
If this commit causes problems, the cause would be widget-callers that don't
pass '--' although they should.
2015-10-28 08:30:05 +02:00
Daniel Shahaf
7e6d960a08
noop: Break out a helper function.
2015-10-28 08:30:05 +02:00
Daniel Shahaf
feec9f58c9
Followup to last: Fix issue number in comment.
2015-10-27 13:38:40 +02:00
Daniel Shahaf
ed6d229b1c
Add XFail test for issue #208 , 'precommand modifiers at non-command-word position'.
2015-10-27 12:33:11 +02:00
Daniel Shahaf
fb5ce43799
noop: Rename a local variable for clarity.
2015-10-27 11:59:25 +02:00
Daniel Shahaf
6fe07c0961
'make test': Fix breakage introduced by 4d3da30f8b:
...
test failure would not be reflected by the exit code of 'make'.
Setting a shell parameter in the left-hand side of a pipe is not visible to
commands after the pipe, because the left-hand side forks. (That's true both
in 'sh' used by 'make' and in 'zsh' that runs tests/test-highlighting.zsh, at
least on my system.) Therefore, move the colorizing hook to where it doesn't
interfere with setting the $something_failed (in tests/test-highlighting.zsh)
and $result (in Makefile) parameters.
2015-10-27 11:59:20 +02:00
Daniel Shahaf
4513eaea71
'make perf': New target.
2015-10-27 09:47:09 +02:00
Daniel Shahaf
9816fcf055
redirections: Test an infix redirection.
2015-10-27 05:20:24 +00:00
Daniel Shahaf
871af68082
sudo: Extend test to cover all codepaths.
2015-10-27 05:09:13 +00:00
Daniel Shahaf
7d45f3e3ec
changelog: Update through HEAD ( 98aee7f8b9).
2015-10-27 07:00:39 +02:00
Daniel Shahaf
98aee7f8b9
Remove path_approx.
...
Fixes zsh-users/zsh-syntax-highlighting#187 .
Adds a test for zsh-users/zsh-syntax-highlighting#204 .
2015-10-27 04:29:05 +00:00
Daniel Shahaf
4d3da30f8b
'make test': Colorize output.
...
Color is only added when "make test"'s stdout is a tty.
2015-10-26 14:31:21 +00:00
Daniel Shahaf
557bb7e0c6
'make test': Allow specifying the zsh binary to use.
2015-10-26 14:18:54 +00:00
Daniel Shahaf
57624bb9f6
Add screenshot.
...
preview-smaller.png is derived from preview.png by 50% downscaling.
Prior art: https://github.com/zsh-readable/zsh-readable/commit/66c18e6b71d5ed1a95bea481e2d6982fd1a3e560
2015-10-24 10:59:20 +00:00
Daniel Shahaf
663c760cc9
minor: test harness: Convert some global failure modes to TAP "Bail out" mode.
2015-10-23 05:34:15 +00:00
Daniel Shahaf
20d106bd4d
noop: Associate an XFAIL test with its issue.
2015-10-23 04:57:05 +00:00
Daniel Shahaf
d66113c1ed
Add XFAIL test for issue #205 , "';' highlighted as unknown-token".
2015-10-23 04:56:02 +00:00
Daniel Shahaf
728ed66ff9
Fix copyright year.
...
Followup to b2ac98b981 .
2015-10-23 04:53:06 +00:00
Daniel Shahaf
8b8b19d91f
test harness: Fix a bug with empty actual or expected results.
...
Fixes zsh-users/zsh-syntax-highlighting#217 .
2015-10-23 04:48:16 +00:00
Daniel Shahaf
a18a7427fd
README: Document 'make install'.
...
Fixes zsh-users/zsh-syntax-highlighting#218 .
2015-10-23 04:45:18 +00:00
Daniel Shahaf
187371a459
chamgelog: Update through HEAD
2015-10-23 04:44:39 +00:00
Daniel Shahaf
c4a9fe9379
test harness: Exit 1 if a 'todo' test passed.
2015-10-23 04:30:00 +00:00
Daniel Shahaf
11c060ab76
test harness: Fix a bug whereby 'todo' state would propagate to all subsequent test points.
...
Update expectations on the subshell test (which triggered this bug, since it has
a passing test point following a 'todo' test point).
2015-10-23 04:26:51 +00:00
Daniel Shahaf
b2ac98b981
Fix issue #216 : test failure with HOME=/nonexistent.
...
Make the test pass by setting explicitly the global state (existing $HOME) it
depends on. Test another value of the global state (a non-existing $HOME).
2015-10-23 03:51:06 +00:00
Antony Lee and Daniel Shahaf
22c8736e2b
Add XFAIL test for issue #160 , "subshells highlighted incorrectly".
2015-10-23 03:31:00 +00:00
Matthew Martin and Daniel Shahaf
d99aa58aaa
test harness: Run each test as a single subshell.
...
That allows tests to be completely independent of each other, so tests that
change global state — such as modify environment variables, define functions or
aliases, or hash commands — will not affect other tests, without needing an
explicit cleanup step.
This enables testing path-tilde-home with and without $HOME set, which is part
of issue #216 .
While at it, convert the test harness to TAP. This fixes issue #180 by adding
support for "not ok 42 # TODO" output.
This commit assumes that 'grep' supports POSIX-compliant -q and -v flags.
Patch-by: Matthew Martin <phy1729@gmail.com >
2015-10-23 03:31:00 +00:00
Daniel Shahaf
083c47b007
regerssion: Look for .version and .revision-hash in the correct place.
...
Fixes zsh-users/zsh-syntax-highlighting#215 .
2015-10-21 06:55:00 +00:00
Daniel Shahaf
30f2f1f144
.gitignore: Add .pc (quilt dir) for the benefit of downstreams
2015-10-21 02:50:37 +00:00
Daniel Shahaf
8631cc1061
README.md += overview description paragraph
...
Based on text by Carsten Hey <carsten@debian.org >.
2015-10-20 14:56:26 +00:00
Daniel Shahaf
cae87016c6
release.md: Add an IRC task.
2015-10-20 14:41:55 +00:00
Daniel Shahaf
cac3d95269
release.md: Document tag process more clearly.
2015-10-20 14:37:14 +00:00
Daniel Shahaf
b5c30ae526
Post-release version number bump.
2015-10-20 14:35:21 +00:00
Daniel Shahaf
fee52920ae
Tag version 0.3.0.
2015-10-20 14:34:59 +00:00
Daniel Shahaf
58b0047c81
changelog: Update through HEAD
2015-10-20 14:32:43 +00:00
Daniel Shahaf
a73b33fc13
release.md: Create tags the way they've always been created.
2015-10-20 14:32:43 +00:00
Daniel Shahaf
c687bddea3
Drop unnecessary shebang lines, part 2.
...
Follow-up to the last commit.
E: zsh-syntax-highlighting: missing-dep-for-interpreter zsh => zsh | zsh-beta (usr/share/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh)
W: zsh-syntax-highlighting: executable-not-elf-or-script usr/share/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh
2015-10-20 12:06:07 +00:00
Daniel Shahaf
c30301d474
Drop unnecessary shebang lines.
...
All these files should be sourced, not executed; and Debian's lintian complains:
W: zsh-syntax-highlighting: script-not-executable usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
2015-10-20 11:49:51 +00:00
Daniel Shahaf
0a7035170a
versioning: Expose .revision-hash as $ZSH_HIGHLIGHT_REVISION.
...
Currently, this only works in installed trees and exported tarballs; the
parameter is left unset when running directly from a git worktree.
2015-10-20 03:07:04 +00:00
Daniel Shahaf
85500ec151
README.md: install with oh-my-zsh in a single command
2015-10-20 00:38:43 +00:00
Daniel Shahaf
bb9c407c95
'make install': Tweak to work with one-shell-per-logical-line 'make' implementations,
...
Tested with 'bmake -B'.
Found-by: Carsten Hey
2015-10-20 00:35:50 +00:00
Vítor Galvão
6f7bf8c0f4
README.md: install with oh-my-zsh in a single command
2015-10-20 01:30:52 +01:00
Matthew Martin and Daniel Shahaf
72b1abd17d
Makefile: declare PHONY targets
2015-10-20 00:26:43 +00:00
Daniel Shahaf
3576df29aa
Don't leak $REPLY into global scope.
...
Fixes issue #213 .
2015-10-20 00:21:11 +00:00
Daniel Shahaf
bde1c83af1
'make test': Pass -f to zsh to minimize environmental variation.
2015-10-19 14:26:01 +00:00
Daniel Shahaf
4604deb652
dev: Document the release process (first draft).
2015-10-19 13:59:30 +00:00
Daniel Shahaf
f48f5400c1
Revert "Do wrap the 'yank' widget, because that works."
...
This reverts commit 8e7c26f489 .
Currently, after a 'yank', paste highlighting (via $YANK_ACTIVE in zsh 5.1.1)
is applied but other highlighting (e.g., string highlighting when the yanked
text is «"foo» as a new word) is not.
See issue #183 for context.
Conflicts:
zsh-syntax-highlighting.zsh
2015-10-19 13:40:51 +00:00
Daniel Shahaf
379ab0d34e
'make install': Install .version and .revision-hash.
2015-10-19 13:36:14 +00:00
Daniel Shahaf
766b350a7d
Wrap yank-pop.
...
As explained in #143 (which was a PR for #99 ), 'yank-pop' only works when the
previous widget has the ZLE_YANK flag, which means wrapping the 'yank' widget
breaks the 'yank-pop' widget (makes it a no-op). However, that is a reason
against wrapping the 'yank' widget, but not against wrapping the 'yank-pop'
widget. Indeed, if 'yank-pop' is wrapped but 'yank' isn't, then yank-pop
functions correctly and updates highlighting properly.
To unbreak yank-pop, either 'yank' should be excluded from wrapping, or one of
the fixes mentioned on issue #183 should be applied.
2015-10-19 08:34:08 +00:00
Daniel Shahaf
fe4e893ce5
changelog: Extend 'suffix aliases' entry.
2015-10-19 08:05:58 +00:00
Daniel Shahaf
e0bb30a153
changelog: Add changelog for 0.2.1..HEAD (0.3.0-dev).
2015-10-19 08:02:27 +00:00
Daniel Shahaf
728784649f
'make install': Install .version and .revision-hash.
2015-10-19 07:35:36 +00:00
Daniel Shahaf
9a3c7d1960
versioning: Add versioning information: .version, .revision-hash, $ZSH_HIGHLIGHT_VERSION.
...
* danielsh/versionstamp:
versionstamp: Set up '.revision-hash' file.
versionstamp: Handle NO_FUNCTION_ARGZERO.
Set the version number.
2015-10-19 07:25:25 +00:00
Daniel Shahaf
c538d6b357
versionstamp: Set up '.revision-hash' file.
2015-10-19 07:21:20 +00:00
Daniel Shahaf
9c56c624e9
versionstamp: Handle NO_FUNCTION_ARGZERO.
...
Sourcing zsh-syntax-highlighting.zsh without FUNCTION_ARGZERO doesn't work (for
reasons unrelated to this branch), but now errors out gracefully. The failure mode
before this branch was:
zsh-syntax-highlighting: highlighters directory '/usr/local/bin/highlighters' not found.
where /usr/local/bin is dirname() of the zsh binary.
2015-10-19 07:21:20 +00:00
Daniel Shahaf
43386376d8
Set the version number.
...
Store it in a separate file so OS packages and 'make install' (issue #177 ) can
reuse it.
2015-10-19 07:20:57 +00:00
Daniel Shahaf
984b4acd78
Makefile: have the default invocation safer.
...
Don't modify $(PREFIX) from 'make', only from 'make install'.
2015-10-19 07:08:42 +00:00
Daniel Shahaf
75d62b9657
Add Makefile
...
Fixes issue #177 (using a different branch than the originally-proposed one).
* phy1729/makefile:
Makefile: Add default for INSTALL
Makefile: exit non-zero for a failed test
Makefile: Add test target
Add Makefile
2015-10-19 06:49:19 +00:00
Matthew Martin
94191f0731
Makefile: Add default for INSTALL
2015-10-19 01:45:15 -05:00
Matthew Martin
2883c9582d
Makefile: exit non-zero for a failed test
2015-10-19 01:45:15 -05:00
Matthew Martin
83c3f96109
Makefile: Add test target
2015-10-19 01:45:15 -05:00
Matthew Martin
7aeadfe01b
Add Makefile
2015-10-19 01:45:15 -05:00
Daniel Shahaf
56c793d96a
docs: Clarify oh-my-zsh installation instructions
...
Suggested-by: Ory Band
(on issue #169 )
2015-10-18 12:46:27 +00:00
Daniel Shahaf
e138cfd765
command word: Protect against the case that the command word starts with a minus.
2015-10-02 13:27:21 +00:00
Daniel Shahaf
07fd773d7e
noop: Add comments.
2015-09-30 01:26:27 +00:00
Daniel Shahaf
5cd1fb26c0
Resolve tilde expansions in command word.
...
This causes '~/bin/foo' to highlight as a command, rather than as a file.
Part of issue #201 .
2015-09-30 00:49:34 +00:00
Daniel Shahaf
faed2fa49e
internal: Fix docstrings.
2015-09-29 23:45:44 +00:00
Daniel Shahaf
69203b1a1d
Don't highlight escaped globbing.
...
Fixes zsh-users/zsh-syntax-highlighting#193 .
2015-09-29 23:44:57 +00:00
Daniel Shahaf
800158745a
Highlight quoted command words correctly.
...
Fixes zsh-users/zsh-syntax-highlighting#147 .
2015-09-28 19:49:39 +00:00
Daniel Shahaf
7b4598a764
Highlight arithmetic expansions.
...
Fixes zsh-users/zsh-syntax-highlighting#188 in the case that both the
opening '((' and closing '))' have been typed, The case that only the
opening '((' have been typed is also fixed, but requires a zsh development
build (zsh-5.1.1-52-g4bed2cf or newer); see comments within.
2015-09-28 13:55:38 +00:00
Daniel Shahaf
52a2ef644b
Don't highlight escaped globbing.
...
Fixes zsh-users/zsh-syntax-highlighting#193 .
2015-09-27 16:28:32 +00:00
Daniel Shahaf
6488284814
back-dollar-quoted-argument: Highlight incomplete escape sequences as unknown-token
...
Followup to 219184f046 , which fixed issue #196 .
2015-09-27 15:59:04 +00:00
Daniel Shahaf
f657406159
minor: Fix comment in last ocmmit.
2015-09-26 18:59:16 +00:00
Daniel Shahaf
8b728522de
Add test for empty commands.
...
Related to issue #205 .
2015-09-26 18:28:56 +00:00
Daniel Shahaf
79e8c2dd48
Don't highlight syntax elements as paths.
...
Without this, redirections, history expansions, and command separators would
be matched by path_approx.
A test case is simply LBUFFER="<" RBUFFER="" (highlighted as redirection with this
fix and as path_approx without it).
Fixes zsh-users/zsh-syntax-highlighting#204 .
2015-09-26 18:28:48 +00:00
Daniel Shahaf
4ec821b2b1
Highlight redirections.
...
Fixes zsh-users/zsh-syntax-highlighting#23 .
* danielsh/i23-highlight-redirections:
Highlight redirections.
2015-09-26 17:58:07 +00:00
Daniel Shahaf
219184f046
Highlight backslash escapes in "" and $'' strings correctly.
...
Remove highlighting of hex and octal escapes in "" strings (which don't parse
those escapes), add it to $'' strings (which do), and correct the regexps.
Also add support for unicode \u/\U escapes.
Fixes zsh-users/zsh-syntax-highlighting#196 .
* danielsh/i196-back-dollar-quoted-v1:
back-dollar-quoted-argument: Correct an off-by-one.
back-dollar-quoted-argument: Correct octal escape syntax.
back-dollar-quoted-argument: Highlight \uHHHH and \UHHHHHHHH escapes.
back-dollar-quoted-argument: Don't consider \0xHH a hex escape sequence.
back-dollar-quoted-argument: Don't consider comma a hex character.
Highlight backslash escapes within $'' strings.
2015-09-26 17:55:10 +00:00
Daniel Shahaf
3fdaec3d4a
WARN_CREATE_GLOBAL: Plug yet another instance.
2015-09-26 16:27:08 +00:00
Daniel Shahaf
6732783d46
back-dollar-quoted-argument: Correct an off-by-one.
...
Highlight the last character of a «\xHH» escape when it is the last thing in
LBUFFER. This is similar to what b0cc02ed86 did
for issue #186 .
2015-09-26 01:09:37 +00:00
Daniel Shahaf
0788514cbd
back-dollar-quoted-argument: Correct octal escape syntax.
...
A leading zero, as in '\0NNN', is permitted by 'echo' but not by 'print',
and «$''» follows 'print'.
2015-09-25 21:54:37 +00:00
Daniel Shahaf
8a43bd2cd9
back-dollar-quoted-argument: Highlight \uHHHH and \UHHHHHHHH escapes.
2015-09-25 21:45:38 +00:00
Daniel Shahaf
98366ade11
back-dollar-quoted-argument: Don't consider \0xHH a hex escape sequence.
...
A leading zero is not permitted in the '\xHH' syntax.
2015-09-25 21:45:38 +00:00
Daniel Shahaf
78ad649d47
back-dollar-quoted-argument: Don't consider comma a hex character.
...
Character class syntax does not ignore commas between ranges.
2015-09-25 21:45:38 +00:00
Daniel Shahaf
69fcb40275
Highlight backslash escapes within $'' strings.
...
Correct highlighting of backslash escapes within "" strings: highlight only
the four specific escape sequences defined there.
Fixes zsh-users/zsh-syntax-highlighting#196 .
2015-09-25 21:45:38 +00:00
Daniel Shahaf
f4164ac86c
internal: Document a function-local variable.
2015-09-25 21:22:09 +00:00
Daniel Shahaf
9c7a1109c8
WARN_CREATE_GLOBAL: don't leak the arithmetic for loop's index variable.
...
Found by code inspection; WARN_CREATE_GLOBAL missed this.
2015-09-25 20:57:51 +00:00
Daniel Shahaf
dd12dde93a
Fix errors with non-reserved-word typeset.
...
Follow-up to 908c4fe150 .
Intended to fix fix zsh-users/zsh-syntax-highlighting#206 .
2015-09-25 17:53:22 +00:00
Daniel Shahaf
cb5589db73
Don't wrap set-local-history.
...
See issue #137 . A reproduction recipe for testing this change:
$ zsh -f
% bindkey -e
% source <the script from http://www.zsh.org/mla/users/2014/msg00321.html users/18584>
% source zsh-syntax-highlighting.zsh
% echo foo
% echo bar
% <^R>echo<^R>
This finds the 'echo foo' with this change but not without it.
2015-09-25 15:35:03 +00:00
Daniel Shahaf
35c4bb7bdc
More WARN_CREATE_GLOBAL cleanups.
...
Followup to 908c4fe150 .
Found by test-perfs.zsh.
2015-09-25 13:04:37 +00:00
Daniel Shahaf
040df93c01
Highlight redirections.
...
Fixes zsh-users/zsh-syntax-highlighting#23 .
2015-09-25 12:42:34 +00:00
Daniel Shahaf
86cd337446
README: Document release announcements.
...
Thanks to tibbs@fedora for setting up anitya.
2015-09-24 23:00:05 +00:00
Daniel Shahaf
c43dc8bd44
dollar-double-quoted-argument: Two patches.
...
* danielsh/i186-dollar-dquote:
dollar-double-quoted-argument: Handle «"foo$"» correctly.
dollar-double-quoted-argument: Highlight "$foo" better.
2015-09-24 19:04:49 +00:00
Daniel Shahaf
66eb801358
dollar-double-quoted-argument: Handle «"foo$"» correctly.
2015-09-24 19:03:17 +00:00
Daniel Shahaf
b0cc02ed86
dollar-double-quoted-argument: Highlight "$foo" better.
...
Now, «"$42foo"» doesn't highlight the «foo», and «"$bar» highlights the «r».
2015-09-24 19:03:00 +00:00
Daniel Shahaf
4ec0c6d7a7
README: Expand the at-end-of-.zshrc FAQ answer.
...
Fixes zsh-users/zsh-syntax-highlighting#185 .
2015-09-24 18:45:35 +00:00
Daniel Shahaf
908c4fe150
Stop leaking variables into global namespace.
...
Set WARN_CREATE_GLOBAL to prevent recurrence.
Fixes zsh-users/zsh-syntax-highlighting#192 .
2015-09-24 18:01:06 +00:00
Daniel Shahaf
1467eae86d
Bump copyright years, part 2.
2015-09-24 16:48:27 +00:00
Daniel Shahaf
9e80fe8f02
Bump copyright years.
2015-09-24 16:46:28 +00:00
Daniel Shahaf
001e6cb404
tests: Cover 'back-quoted-argument'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-23 15:41:17 +00:00
Daniel Shahaf
22fa215e05
Fixup last commit.
...
* highlighters/main/test-data/hashed-command.zsh:
Set the right region key. This makes the test more specific.
(Issue #184 would have caught this bug.)
2015-09-23 15:39:53 +00:00
Daniel Shahaf
845361ef3d
tests: Cover 'hashed-command'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-23 15:35:56 +00:00
Daniel Shahaf
4594d8b7ec
Merge remote-tracking branch 'danielsh/i199-semicolon-v1'
...
* danielsh/i199-semicolon-v1:
Fix regression: Highlight ';' as commandseparator.
Follow-up to 547b8be304 : Fix $observed_result calculation.
Fixes zsh-syntax-highlghting/zsh-users#199 .
2015-09-23 15:23:25 +00:00
Daniel Shahaf
5fb4cb2f72
Fix regression: Highlight ';' as commandseparator.
...
This was broken by c2b9327b07
and tracked as zsh-users/zsh-syntax-highlighting#199 .
This fixes the vanilla-newline.zsh test, which was was (consciously) broken
by the previous commit.
2015-09-23 14:50:22 +00:00
Daniel Shahaf
f7cb4741d6
Followup to previous: Extend the 'alias' test.
2015-09-18 22:04:07 +00:00
Daniel Shahaf
81c8d78d12
tests: Cover 'alias' and 'suffix-alias'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-18 21:42:22 +00:00
Daniel Shahaf
8767e0ef66
tests: Cover 'reserved-word'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-18 20:38:32 +00:00
Daniel Shahaf
b056f592f2
tests: Cover 'path_prefix'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-18 20:21:19 +00:00
Daniel Shahaf
e0a7ddb6ec
tests: Cover 'history-expansion'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-18 20:01:10 +00:00
Daniel Shahaf
416934202e
tests: Cover 'single-quoted-argument', 'double-hyphen-option', and 'function'.
...
This is part of issue zsh-users/zsh-syntax-highlighting#198 .
2015-09-18 19:21:21 +00:00
Daniel Shahaf
627eb71940
tests: Use $unused_highlight in more places.
...
Notably, the 'single-hyphen-option' and 'assign' contexts both default to the
'none' style, so before this patch, the tests would not have detected a failure
to apply those two contexts.
For other contexts, using $unused_highlight only helps detect the case where
the right highlight style (e.g., 'fg=yellow') is used as a result of applying
the wrong context — which should be a theoretical failure mode.
This is part of zsh-users/zsh-syntax-highlighting#198 .
2015-09-18 18:44:45 +00:00
Daniel Shahaf
00862cf4fa
Followup to e5c2a88db0 (merged in 51102bf83f):
...
Have widgets return EXIT_SUCCESS.
2015-09-18 12:38:24 +00:00
Daniel Shahaf
aab1b8f50f
Follow-up to 547b8be304: Fix $observed_result calculation.
...
In region_highlight, a spec of the form 'i j foo' with i >= j should have no effect.
Before this commit, however, the {$i..$j} range would happily expand to (5 4 3)
if i > j were the case (e.g., i=5 and j=3).
This breaks vanilla-newline.zsh; the next commit will fix that.
2015-09-17 23:40:20 +00:00
Daniel Shahaf
4068413dfe
tests: Let each test change the highlight styles.
...
This way, each test can set custom styles to specific highlight contexts
(to differentiate those contexts) without affecting later tests.
2015-09-17 23:35:44 +00:00
Daniel Shahaf
404d498e1d
tests: vanilla-newline.zsh: Fix expectations
2015-09-17 23:33:56 +00:00
Daniel Shahaf
05ab9f7342
tests: Run only *.zsh files.
...
Otherwise, *.rej patch files would be run by zsh, with unpredictable results.
2015-09-17 20:11:05 +00:00
Daniel Shahaf
0d3a5dadea
tests: Add test for escape sequences in double-quoted strings
2015-09-17 20:01:46 +00:00
Daniel Shahaf
51102bf83f
Highlight the region and yanks and pastes on top of syntax highlighting.
...
Fixes zsh-users/zsh-syntax-highlighting#165 .
Fixes zsh-users/zsh-syntax-highlighting#175 .
* danielsh/i165-region-v1:
Highlight yanks/pastes on top of syntax highlighting.
Highlight the region on top of syntax highlighting.
2015-09-17 19:21:25 +00:00
Daniel Shahaf
186536705b
tests: path-tilde-named.zsh: Fix expectations
...
The path string ends at offset 26, not 23.
2015-09-17 19:09:33 +00:00
Daniel Shahaf
547b8be304
test harness: Fix off-by-one discrepancy between observed and expected.
...
Fixes zsh-users/zsh-syntax-highlighting#195 .
The one revision made on master between this branch's creation and merge
already uses correct offsets.
* danielsh/i195-tests-offbyone-v1:
New test for dollar-double-quoted-argument.
test harness: Fix off-by-one discrepancy between observed and expected.
2015-09-17 19:08:29 +00:00
Daniel Shahaf
80587e5419
New test for dollar-double-quoted-argument.
...
This exercises the previous patch.
2015-09-12 20:48:25 +00:00
Daniel Shahaf
c46b8d169e
test harness: Fix off-by-one discrepancy between observed and expected.
...
Fixes issue #195 .
2015-09-12 20:48:25 +00:00
Daniel Shahaf
a8afbdf2f5
Support $''-quoted strings.
...
This does not yet highlight backslash escapes within them.
2015-09-10 20:02:39 +00:00
Daniel Shahaf
6d93ea07fd
main highlighter docs: README: Tweak.
2015-09-10 19:46:01 +00:00
Daniel Shahaf
4f5a0fe60b
main highlighter docs: Give examples of styles.
2015-09-10 19:44:19 +00:00
Daniel Shahaf
e5c2a88db0
Highlight yanks/pastes on top of syntax highlighting.
...
Let $zle_highlight[paste] override $region_highlight.
2015-09-10 19:31:36 +00:00
Daniel Shahaf
0e31d6e1a2
Highlight the region on top of syntax highlighting.
...
Let $zle_highlight[region] override $region_highlight.
2015-09-08 20:22:22 +00:00
Daniel Shahaf
555e142e66
suffix aliases: Highlight differently.
...
Add an underline, since they are at command word position but will be executed
by something else.
Suggested-by: Daniel Hahler
2015-09-08 10:13:16 +00:00
Daniel Shahaf
e13c5a1611
Highlight 'noglob' correctly in more cases.
...
Fixes zsh-users/zsh-syntax-highlighting#189 .
2015-09-07 18:07:59 +00:00
Daniel Shahaf
8515b7e0c5
Highlight ? as globbing.
...
Fixes zsh-users/zsh-syntax-highlighting#94 .
2015-09-07 18:05:56 +00:00
Daniel Shahaf
dc701501e5
Highlight ? as globbing.
...
Fixes zsh-users/zsh-syntax-highlighting#94 .
2015-09-07 18:03:14 +00:00
Daniel Shahaf
9310d8ae71
Support suffix aliases
...
Fixes zsh-users/zsh-syntax-highlighting#126 .
2015-09-07 17:59:52 +00:00
Daniel Shahaf
b3ceea8511
Highlight 'noglob' correctly in more cases.
...
Fixes zsh-users/zsh-syntax-highlighting#189 .
2015-09-07 09:09:17 +00:00
Daniel Shahaf
a0b5bc6c71
Fix bug in previous commit ( d330b49b33)
...
'local' is a reserved word in zsh 5.1 but not in earlier versions [1].
Therefore, under zsh older than 5.1, quoting is required.
This manifested as random «builtin=''» in emitted to the terminal, and
commands (such as 'echo') highlighted as errors (in red).
[1] https://github.com/zsh-users/zsh/blob/master/README#L46
(the section "Incompatibilites between 5.0.8 and 5.1")
2015-09-07 01:26:11 +00:00
Daniel Shahaf
d330b49b33
Fix variable leakage into global namespace.
...
Similar to zsh-users/zsh-syntax-highlighting#97 .
2015-09-06 19:20:49 +00:00
Daniel Shahaf
f78919d941
Preserve $? of wrapped widgets.
2015-09-05 21:44:11 +00:00
Daniel Shahaf
eaffd88793
docs: Document homebrew package name.
...
Fixes zsh-users/zsh-syntax-highlighting#156 .
2015-09-05 19:21:52 +00:00
Daniel Shahaf
546a5288e2
multiline strings: Add a second test for commit ff4d402e9a
2015-09-05 15:08:08 +00:00
Daniel Shahaf
8e7c26f489
Do wrap the 'yank' widget, because that works.
...
Partly reverts eb9870f4db which was PR #143 to
fix issue #99 .
2015-09-05 12:50:32 +00:00
Daniel Shahaf
7f41967a17
Highlight array appends: foo+=(bar baz).
...
Fixes zsh-users/zsh-syntax-highlighting#181 .
2015-09-05 09:38:02 +00:00
Daniel Shahaf
13a8db1d71
tests: exit non-zero upon failure
2015-09-05 09:27:51 +00:00
Daniel Shahaf
51aed8a765
Merge remote-tracking branch 'upstream/pr/179'
...
* upstream/pr/179:
Don't parse first word of array assignment as command
2015-09-04 17:57:08 +00:00
Daniel Shahaf
42495cc5d6
Merge remote-tracking branch 'upstream/pr/161'
...
* upstream/pr/161:
Don't highlight prefix redirections as error
2015-09-04 17:27:25 +00:00
Daniel Shahaf
ea81e3df6e
Merge remote-tracking branch 'upstream/pr/159'
...
* upstream/pr/159:
Support literal newlines, part 2
Update comments. No functional change.
Highlight the first part of multiline strings correctly
Support literal newlines
Support backslash continuations
Support multiline strings
Refactoring, no functional change
2015-09-04 17:27:03 +00:00
Daniel Shahaf
c2b9327b07
Support literal newlines, part 2
2015-09-02 09:30:08 +00:00
Daniel Shahaf
52ece975c3
Update comments. No functional change.
2015-09-02 02:37:43 +00:00
Daniel Shahaf
7ee9df915d
Merge remote-tracking branch 'origin/pr/158'
...
* origin/pr/158:
README: give the rationale for the at-end-of-.zshrc requirement
2015-09-01 16:26:04 +00:00
Daniel Shahaf
85b3446897
README: make installation step 1 more accurate
...
Based on a patch by George Angelopoulos <george@usermod.net >.
Closes #149 .
2015-08-31 17:27:56 +00:00
Daniel Shahaf
b9b67b9f78
Don't parse first word of array assignment as command
...
Fixes zsh-users/zsh-syntax-highlighting#178
2015-08-28 09:52:52 +00:00
Daniel Shahaf
359d48bf78
Don't highlight prefix redirections as error
...
Fixes zsh-users/zsh-syntax-highlighting#146
2015-02-16 02:44:56 +00:00
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.
2015-02-02 15:12:59 +00:00
Daniel Shahaf
384be15b13
Support literal newlines
2015-01-27 10:23:59 +00:00
Daniel Shahaf
23cacb12fe
Support backslash continuations
2015-01-27 10:23:59 +00:00
Daniel Shahaf
667495bfb7
Support multiline strings
2015-01-27 10:23:58 +00:00
Daniel Shahaf
2c5acaefa9
Refactoring, no functional change
...
The new function will be used in the next commit.
2015-01-27 10:23:58 +00:00
Daniel Shahaf
0c8c4b73f8
README: give the rationale for the at-end-of-.zshrc requirement
2015-01-27 10:23:21 +00:00
George Angelopoulos
a723f504a5
README: make installation step 1 more accurate
...
You cannot download just the "script". You need the entire directory/repo.
2014-09-25 08:20:47 +03:00
nicoulaj
3dc5741900
Merge pull request #140 from randomize/pr_fix_issue_#77
...
Pr fix issue #77
2014-09-24 22:58:20 +02:00
nicoulaj
10391d025a
Merge pull request #134 from sonnym/enable_quick_history_substitution_highlighting
...
highlight ^old^new pattern
2014-09-24 22:54:21 +02:00
nicoulaj
443908b9a2
Merge pull request #142 from jcassee/master
...
Add 'line' highlighter for the whole buffer
2014-09-24 22:50:54 +02:00
nicoulaj
eb9870f4db
Merge pull request #143 from vincentbernat/fix/yank-pop
...
zle: don't override yank/yank-pop
2014-09-24 22:49:21 +02:00
Vincent Bernat
74a183447d
zle: don't override yank/yank-pop
...
`yank-pop` relies on the fact that the last zle command is `yank` or
`yank-pop` to work correctly. Rewriting them prevents this check to work
correctly breaking `yank-pop`.
This fix just disallow overriding of those two zle commands. As a
side-effect, syntax highlighting will not happen when using.
This fixes #99 .
2014-06-29 11:52:32 +02:00
Joost Cassee
d7d4dff1c8
Add 'line' highlighter for the whole buffer
2014-06-08 00:04:00 +02:00
Randy
7edd08156e
Chaned main highlighter alorithm to resolve issue #77
2014-03-29 22:52:10 +02:00
Randy
e8cc271314
Resolves slow performance in brackets highlighter
2014-03-24 08:45:34 +02:00
Julien Nicoulaud
5320f1e18d
Merge pull request #135 from arcan1s/patch-1
...
Update README.md
2014-01-15 04:15:52 -08:00
Evgeniy Alexeev
dcb5da9457
Update README.md
...
Edited links to Archlinux packages (the link to `zsh-syntax-highlighting-git` is out-of-date, and `zsh-syntax-highlighting` is now available in [community])
2014-01-09 04:21:35 +03:00
Julien Nicoulaud
c83e266888
#110 : Now using :A modifier, bump zsh version requirement
2013-12-24 12:40:35 +01:00
Julien Nicoulaud
072c064d2a
Merge pull request #110 from xaocon/master
...
small change to find highlighting directory better
2013-12-24 03:39:37 -08:00
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
2013-12-07 05:11:19 -05:00
Julien Nicoulaud
f289a9f8e7
Merge pull request #125 from acatton/fix-121
...
Fix #121 : sudo syntax highlighting incorrectly
2013-11-19 11:42:03 -08:00
Julien Nicoulaud
8ac964186d
Merge pull request #131 from MarkLodato/array-assignments
...
Properly highlight array assignments
2013-11-19 11:40:29 -08:00
Julien Nicoulaud
ffce2a0b20
Merge pull request #133 from lucc/master
...
protect alias expansion from interpreting aliases as options
2013-11-19 11:39:40 -08:00
Julien Nicoulaud
63a720af9b
Merge pull request #128 from knu/patch-1
...
Do not leak a variable: cdpath_dir.
2013-11-19 11:38:50 -08:00
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.
2013-11-05 00:50:20 +01:00
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.
2013-10-30 00:53:46 -04:00
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
2013-10-30 00:00:16 -04:00
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`.
2013-10-21 21:18:38 +09:00
Evan Pitstick
dffbab0c92
a more simple and universal way (for zsh projects) to find highlight dir path
2013-10-09 12:02:34 -04:00
Antoine Catton
3b3a58be91
Fix #121 : sudo syntax highlighting incorrectly
...
Parse sudo command line in order to highlight the options correctly
2013-09-28 19:33:34 -06:00
Julien Nicoulaud
dbd27cb30a
#155 : document path_prefix/path_approx
2013-08-09 09:56:28 +02:00
Julien Nicoulaud
08b80022ca
Merge pull request #123 from Shura0/master
...
Highlighted dollar variable ver. 2
2013-08-09 00:47:32 -07:00
Shura
a7ee0597ef
Update main-highlighter.zsh
...
Comments added
2013-08-09 10:24:14 +04:00
Julien Nicoulaud
3677b75731
Merge pull request #115 from Valodim/master
...
add separate path_prefix and path_approx hilights
2013-08-08 07:31:46 -07:00
Julien Nicoulaud
3f2c76f393
Merge pull request #116 from jameskyle/feature/Issue-#92-silence-system-bell-in-osx
...
Issue #92 Eliminates system bell errors on osx.
2013-08-08 07:26:22 -07:00
Julien Nicoulaud
6fcdb06b28
Merge pull request #122 from shockone/master
...
Update main-highlighter.zsh
2013-08-08 07:25:54 -07:00
Владимир
57c01d19de
Update main-highlighter.zsh
...
Add support of CDPATH
2013-08-07 03:21:15 +03:00
Shura
8abcf187f6
dollar variable and backslash codes highlighting
2013-07-29 17:33:34 +04:00
James Kyle
93827ed84d
Issue #92 Eliminates system bell errors on osx.
...
Prepended an 'if' to remove error bell on osx systems.
2013-07-25 11:39:21 -07:00
Vincent Breitmoser
228f5a6aad
add separate path_prefix and path_approx hilights
2013-07-25 04:41:09 +02:00
Evan Pitstick
0fcc2629d2
Finds highlighters dir a little better
2013-03-08 00:57:16 -05:00
Julien Nicoulaud
e5d8a50d36
Merge pull request #106 from cknadler/master
...
Fix relative links in various project readmes
2013-02-27 04:42:09 -08:00
Chris Knadler
612e493cba
Fix relative links in highlighters readme
2013-02-26 18:03:35 -08:00
Chris Knadler
408b100295
Fix relative link in main readme
2013-02-26 17:59:53 -08:00
Julien Nicoulaud
a0862053f5
Merge pull request #100 from hchbaw/for-nicoulaj/pattern-local
...
make $pattern local to _zsh_highlight_pattern_highlighter #97
2012-12-19 10:30:06 -08:00
Takeshi Banse
b4e667795c
make $pattern local to _zsh_highlight_pattern_highlighter #97
...
Signed-off-by: Takeshi Banse <takebi@laafc.net >
2012-12-09 10:43:00 +09:00
Julien Nicoulaud
45194671af
Merge pull request #91 from xaocon/master
...
Added sudo as a precommand
2012-08-26 03:33:34 -07:00
evan
19981ef9ea
added sudo as a precommand
2012-08-17 15:52:09 -04:00