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
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
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
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