Daniel Shahaf
c216242b46
command word: Highlight more reserved words. Part of issue #207 .
9 years ago
Daniel Shahaf
2218e26bf8
command word: Highlight 'else' correctly. Part of issue #207 .
9 years ago
Daniel Shahaf
b397b12ac1
command word: Start fixing issue #207 , "Word following certain reserved words should be a command word".
9 years ago
Daniel Shahaf
87deac3062
command word: Add an XFail test for issue #207 .
9 years ago
Daniel Shahaf
01d7eeb3c7
Fix issue #205 , "';' after assignment is highlighted as unknown-token".
9 years ago
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).
9 years ago
Daniel Shahaf
be006aded5
sudo/redirections: Fix part of issue #221 , "sudo and redirection don't mix".
9 years ago
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.
9 years ago
Daniel Shahaf
018bc45f21
Followup to last: tighten the fix and ask a question.
9 years ago
Daniel Shahaf
2c9f8c8c95
Fix issue #209 , "precommand modifiers at non-command-word position".
9 years ago
Daniel Shahaf
88cf98d9c4
states work: Documents the various states.
9 years ago
Daniel Shahaf
0aa6a5db78
states work: Convert $new_expression parsing.
9 years ago
Daniel Shahaf
10b1da64e6
states work: Convert sudo parsing.
9 years ago
Daniel Shahaf
80d692c400
command word: Add an XFail test for issue #194 , "Highlight anonymous functions".
9 years ago
Daniel Shahaf
e49251b6fa
sudo/redirections: Add two XFail tests for issue #221 , "sudo and redirection don't mix".
9 years ago
Daniel Shahaf
2080a441ac
minor: Remove redundant setting of $highlight_glob.
9 years ago
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.)
9 years ago
Daniel Shahaf
7723edf4f5
Add an XFail test for accept-line semantics.
9 years ago
Daniel Shahaf
feec9f58c9
Followup to last: Fix issue number in comment.
9 years ago
Daniel Shahaf
ed6d229b1c
Add XFail test for issue #208 , 'precommand modifiers at non-command-word position'.
9 years ago
Daniel Shahaf
fb5ce43799
noop: Rename a local variable for clarity.
9 years ago
Daniel Shahaf
9816fcf055
redirections: Test an infix redirection.
9 years ago
Daniel Shahaf
871af68082
sudo: Extend test to cover all codepaths.
9 years ago
Daniel Shahaf
98aee7f8b9
Remove path_approx.
Fixes zsh-users/zsh-syntax-highlighting#187 .
Adds a test for zsh-users/zsh-syntax-highlighting#204 .
9 years ago
Daniel Shahaf
20d106bd4d
noop: Associate an XFAIL test with its issue.
9 years ago
Daniel Shahaf
d66113c1ed
Add XFAIL test for issue #205 , "';' highlighted as unknown-token".
9 years ago
Daniel Shahaf
728ed66ff9
Fix copyright year.
Followup to b2ac98b981
.
9 years ago
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).
9 years ago
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).
9 years ago
Antony Lee
22c8736e2b
Add XFAIL test for issue #160 , "subshells highlighted incorrectly".
9 years ago
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
9 years ago
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
9 years ago
Daniel Shahaf
e138cfd765
command word: Protect against the case that the command word starts with a minus.
9 years ago
Daniel Shahaf
07fd773d7e
noop: Add comments.
9 years ago
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 .
9 years ago
Daniel Shahaf
faed2fa49e
internal: Fix docstrings.
9 years ago
Daniel Shahaf
800158745a
Highlight quoted command words correctly.
Fixes zsh-users/zsh-syntax-highlighting#147 .
9 years ago
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.
9 years ago
Daniel Shahaf
52a2ef644b
Don't highlight escaped globbing.
Fixes zsh-users/zsh-syntax-highlighting#193 .
9 years ago
Daniel Shahaf
6488284814
back-dollar-quoted-argument: Highlight incomplete escape sequences as unknown-token
Followup to 219184f046d40cc723606797666dab18f8a6aea7, which fixed issue #196 .
9 years ago
Daniel Shahaf
f657406159
minor: Fix comment in last ocmmit.
9 years ago
Daniel Shahaf
8b728522de
Add test for empty commands.
Related to issue #205 .
9 years ago
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 .
9 years ago
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 .
9 years ago
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'.
9 years ago
Daniel Shahaf
8a43bd2cd9
back-dollar-quoted-argument: Highlight \uHHHH and \UHHHHHHHH escapes.
9 years ago
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.
9 years ago
Daniel Shahaf
78ad649d47
back-dollar-quoted-argument: Don't consider comma a hex character.
Character class syntax does not ignore commas between ranges.
9 years ago
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 .
9 years ago
Daniel Shahaf
f4164ac86c
internal: Document a function-local variable.
9 years ago