Commit Graph
100 Commits
Author SHA1 Message Date
Daniel Shahaf 7fb6f99791 'main': Try the "non-command word" codepath when a word may be either a command word or a non-command word.
Fixes #231.
Fixes #330.
2016-06-03 04:25:00 +00:00
Daniel Shahaf fccf92402b minor: tests: Formatting tweak to XPASS output.
Remove superfluous single quotes around the second hyphen.
2016-06-03 03:57:45 +00:00
Daniel Shahaf 29b30e0ca7 'main': Add XFail test for issue #330, concerning command word after array assignment. 2016-06-03 03:42:12 +00:00
Daniel Shahaf f4036a09ce 'main': Highlight scalar assignments to argv
Assignments to positional parameters using scalar assignment syntax is
a feature: it is covered by upstream's test suite ("append to positional
parameter" in Test/A06assign.ztst).
2016-06-03 03:27:52 +00:00
Daniel Shahaf 14711a51f3 tests: Explicitly test 'default' style inside an array assignment. 2016-06-03 02:41:10 +00:00
Daniel Shahaf f060622dc6 'main': Internal cleanup: drop $style_override.
Merge remote-tracking branch 'upstream/pr/326'

* upstream/pr/326:
  'main': Internal cleanup: drop $style_override.

Conflicts:
	highlighters/main/main-highlighter.zsh (context lines only)
2016-06-01 05:45:39 +00:00
Daniel Shahaf a5b8bc0ef0 'main': Internal cleanup: drop $style_override.
Changes the interface of _zsh_highlight_main_highlighter_check_path().

Suggested-by: m0viefreak
2016-05-27 10:21:28 +00:00
Daniel Shahaf f146651913 Merge part of PR #298
* commit '2f18ba':
  'main': use zsh/parameter to resolve alias
  driver: load zsh/parameter if available
2016-05-13 02:27:29 +00:00
Daniel Shahaf def8c0da83 Bump copyright years. 2016-05-13 01:29:49 +00:00
Daniel Shahaf 4f5bb6cf96 Merge remote-tracking branch 'upstream/pr/308' into HEAD
* upstream/pr/308:
  'main': Fix issue #302, "Process substitution misparsed as redirection".
  'main': Factor out common code.  No functional change.
  'main': Add a regression test for issue #302, "Process substitution misparsed as redirection".
2016-05-13 01:24:01 +00:00
Daniel Shahaf 0ff354b44b docs: Namespace highlighters' styles.
Follow-up to 2176692704.

Part of #306.
2016-05-12 19:28:17 +00:00
Daniel Shahaf 7b82b88a71 'main': Don't leak the PATH_DIRS options.
Found-by: m0viefreak
(in #298)
2016-05-12 19:24:00 +00:00
Daniel Shahaf 5a98cd3a10 Merge remote-tracking branch 'upstream/pr/315' into HEAD
* upstream/pr/315:
  'main': optimization that in my tests shows 2.7s -> 2.2s
2016-05-12 18:30:50 +00:00
Daniel Shahaf 162c826452 docs: Honour $ZDOTDIR in code examples.
Keep references in prose as '~/.zshrc': using $ZDOTDIR in that context would
be confusing, and people who set $ZDOTDIR understand these references.
2016-05-12 13:29:10 +00:00
Daniel Shahaf a00ed24ba3 docs: Simplify/clarify installation instructions.
This also removes an implicit assumption that ~/.zshrc is idempotent.
2016-05-12 13:25:59 +00:00
Daniel Shahaf 62f1c108f3 tests: New test to capture off-by-ones.
Inspired by #312.
2016-05-11 20:36:18 +00:00
Daniel Shahaf 15db71abd0 driver: Track rename of an unreleased upstream API.
ISEARCH_ACTIVE was renamed ISEARCHMATCH_ACTIVE in workers/38921
(commit f06be0ffcf2c to zsh itself).

Fixes #299.
2016-05-09 03:38:27 +00:00
Daniel Shahaf fc9c892a3f 'main': Fix issue #302, "Process substitution misparsed as redirection". 2016-05-09 03:29:27 +00:00
Daniel Shahaf bfabffbf97 'main': Factor out common code. No functional change. 2016-05-09 03:26:29 +00:00
Daniel Shahaf 6889ff6bd2 'main': Add a regression test for issue #302, "Process substitution misparsed as redirection". 2016-05-09 03:26:06 +00:00
Daniel Shahaf f0bae44b76 tests: Followup to last: echo(1) is evil.
Use 'print -r --' instead, so literal backslashes in $BUFFER aren't expanded.

Found-by: Matthew Martin
2016-05-05 20:34:43 +00:00
Daniel Shahaf 3176b9567c minor: tests: Quote $BUFFER differently on output.
The new output improves readability of the 'main' highlighter's test output.
2016-05-05 19:33:56 +00:00
Daniel Shahaf 6aa57d60aa tests: TAP support: Emit a 'description' for all test points 2016-05-05 19:11:49 +00:00
Daniel Shahaf f83bca0847 minor: tests: Introduce a local variable. No functional change. 2016-05-05 19:11:28 +00:00
Daniel Shahaf 70b5687d66 minor: tests: Tighten up local variable scope. 2016-05-05 19:11:07 +00:00
Daniel Shahaf 21207c336a tests: TAP compliance: Do not emit literal '#' in the 'description' part 2016-05-05 19:11:07 +00:00
Daniel Shahaf 56a867076c tests: Followup to fd061b5730: quote both expected and actual output. 2016-05-05 19:10:06 +00:00
Daniel Shahaf cef49752fd dev docs: Create HACKING.md.
Review-by: Matthew Martin
2016-05-05 01:20:32 +00:00
Daniel Shahaf e8af14fe1f minor: Rewrap docs for uncompiled readability. 2016-05-03 15:00:48 +00:00
Daniel Shahaf f34714b8ee Bump copyright years. 2016-04-30 02:11:17 +00:00
Daniel Shahaf c54c076cfa cleanup: Avoid colon after parameter expansion to avoid risking introducing a colon modifier. 2016-04-24 17:08:08 +00:00
Daniel Shahaf b52a485c5c brackets: Optimize a tiny bit.
Compute «${#BUFFER}» just once.  I haven't measured the effect of this, but
it might just avoid a strlen() every time around the loop, which could add
up for large ${BUFFER}s.

See issue #295.
2016-04-22 14:14:15 +00:00
Daniel Shahaf 367929502f release.md: Add a release checklist line item. 2016-04-05 05:49:18 +00:00
Daniel Shahaf bc7f8ea433 'main': Restore support for zsh-4.3.10 and older.
zsh older than workers/28418 (zsh revision 23bdfc7fd2a012d5205ed22d18eb39e41c8fbc95)
doesn't support the «${name:offset:length}» syntax.  Therefore, use the older
«$name[start,end]» syntax instead.

Followup to 3cb58fd7d7, "Optimization: -1 is
extra computation of string length internally".

Fixes zsh-users/zsh-syntax-highlighting#279.
2016-03-23 01:32:44 +00:00
Daniel Shahaf cb02451a4e widget binding: Fix crucial typo in last commit. 2016-03-18 15:14:09 +00:00
Daniel Shahaf 11d378332e widget binding: Further unbreak the build.
7e7e291b20 broke 'zle -C' completions, as reported in #278 just now.
2016-03-18 15:12:04 +00:00
Daniel Shahaf 6a634fac9f widget binding: Properly escape widget names at definition.
Re-Fixes zsh-users/zsh-syntax-highlighting#278.
2016-03-18 14:53:53 +00:00
Daniel Shahaf 47a664447c noop: Remove stray statement terminators and line joiners. 2016-03-18 14:47:53 +00:00
Daniel Shahaf 261c180a36 widget binding: Unbreak the build.
The last commit inadvertently broke interactive use, although the test suite passed.

See issue #278.
2016-03-18 14:41:18 +00:00
Daniel Shahaf 7e7e291b20 widget binding: Remove an unnecessary layer of indirection.
The 'eval' was never needed, and the lack of proper quoting of the interpolated
variables caused issues, such as #278.

Fixes zsh-users/zsh-syntax-highlighting#278.
2016-03-18 13:58:55 +00:00
Daniel Shahaf 4c23a2fd1b 'main': Highlight lone '!' correctly: it's not a history expansion.
While here, also add a test for the '!' reserved word (which is highlighted
since c216242b).
2016-03-13 02:47:25 +00:00
Daniel Shahaf e635f766be docs: Clarify oh-my-zsh installation instructions.
Thanks to Andrew Janke.

Fixes zsh-users/zsh-syntax-highlighting#270.
2016-03-12 18:36:44 +00:00
Daniel Shahaf 18df692ae6 widget binding: Remove some too-wide exclusions
* m0vie/p_bindings:
  widget binding: don't exlude widgets with identical function name
  widget binding: don't exclude widgets starting with '_'
2016-03-12 17:24:03 +00:00
Daniel Shahaf 7044c1986e docs: use https:// instead of git:// 2016-02-18 13:39:24 +00:00
Daniel Shahaf e500ca2462 'main': Don't highlight in vared
This is a continuation of 451665cb2a which did
the same for the $PS3 prompt.

Reported-by: Sebastian Gniazdowski
2016-02-14 17:34:53 +02:00
Daniel Shahaf e938825a85 Merge pull request #272 from psprint/master
Optimization: -1 is extra computation of string length internally
2016-02-14 14:32:01 +00:00
Daniel Shahaf 683f4837a0 changelog: Update for upcoming 0.4.1 release. 2016-01-27 20:48:56 +00:00
Daniel Shahaf 62a6be3d63 Version number bump.
Have master self-describe as 0.5.0-dev, since an 0.4.1 release is upcoming on
another branch.
2016-01-27 20:38:38 +00:00
Daniel Shahaf 451665cb2a 'main': Don't highlight at the $PS3 prompt.
The input to the $PS3 prompt is not commands, so the 'main' highlighter is
not applicable to it.

Fixes zsh-users/zsh-syntax-highlighting#268.
2016-01-20 22:10:49 +00:00
Daniel Shahaf 30d8f92df2 test harness: Properly quote error message interpolations.
No functional change, except that error messages are now more readable.
2016-01-20 22:02:25 +00:00
Daniel Shahaf 282c7134e8 Revert "wrapping: Don't add '--' when invoking widgets."
The '--' guard was correct; it was there to guard against arguments belonging
to the syntax «zle widget [ -n num ] [ -Nw ] [ -K keymap ] args».

For example, this affected using <backward-kill-word> over
    BUFFER="-w "
    CURSOR=3
after
    autoload -Uz select-word-style
    select-word-style default
    zstyle ':zle:backward-kill-word' word-style shell
.

This reverts commit c808d2187a.
2016-01-17 19:43:48 +00:00
Daniel Shahaf 28932316cc aliases: Highlight aliases with '=' in their LHS as error. (Part of issue #263.) 2016-01-11 15:27:48 +00:00
Daniel Shahaf 5e4b446dee aliases: Add a test for one variant of issue #263. 2016-01-11 15:07:18 +00:00
Daniel Shahaf 9b64ad750f tests: Add a 'print failures only' mode to 'make test', called 'make quiet-test'.
Fixes zsh-users/zsh-syntax-highlighting#262.

Currently, 'make quiet-test' uses Perl.  However, since it is considered a development
tool rather than a user-facing tool, users and downstream packages needn't install Perl.
Furthermore, even this dev-only dependency may be dropped in the future.

The only difference between tests/tap-filter here and the one in the issue is using
a `cat` subshell v. using 'undef $/; <STDIN>'.
2016-01-02 21:22:01 +00:00
Daniel Shahaf 936e2e9314 tests: Add another comment. No functional change. 2016-01-02 20:52:40 +00: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
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
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