Daniel Shahaf
a5b8bc0ef0
'main': Internal cleanup: drop $style_override.
Changes the interface of _zsh_highlight_main_highlighter_check_path().
Suggested-by: m0viefreak
8 年之前
m0viefreak
3b67e656bf
'main': Implement simple command type cache
8 年之前
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.
8 年之前
m0viefreak
61f43255ab
'main': Support multiple styles in _zsh_highlight_main_add_region_highlight
8 年之前
Matthew Martin
d37c55c788
minor: tests: Add comment for NONE in expected_region_highlight
8 年之前
Matthew Martin
364f206a54
docs: Give example of test that modifies its environment
8 年之前
Matthew Martin
19acd8e844
docs: Mention `$BUFFER`
8 年之前
Matthew Martin
13018f3dd7
docs: Document use of NONE in expected_region_highlight
8 年之前
Matthew Martin
0f43026bf0
docs: Document writing tests
8 年之前
Matthew Martin
1082067f93
tests: Fail on stderr output
Closes #291 .
8 年之前
Daniel Shahaf
f146651913
Merge part of PR #298
* commit '2f18ba':
'main': use zsh/parameter to resolve alias
driver: load zsh/parameter if available
8 年之前
m0viefreak
2f18ba64e3
'main': use zsh/parameter to resolve alias
If possible, use zsh/parameter to avoid forks.
Fixes #263 .
8 年之前
m0viefreak
3ce01076b5
driver: load zsh/parameter if available
8 年之前
Daniel Shahaf
def8c0da83
Bump copyright years.
8 年之前
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".
8 年之前
Daniel Shahaf
0ff354b44b
docs: Namespace highlighters' styles.
Follow-up to 2176692704
.
Part of #306 .
8 年之前
Daniel Shahaf
7b82b88a71
'main': Don't leak the PATH_DIRS options.
Found-by: m0viefreak
(in #298 )
8 年之前
Sebastian Gniazdowski
ef4bfe5bcc
'main': 2nd optimization that in my tests shows 2.2s -> 2.0s
8 年之前
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
8 年之前
Sebastian Gniazdowski
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.
8 年之前
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.
8 年之前
Daniel Shahaf
a00ed24ba3
docs: Simplify/clarify installation instructions.
This also removes an implicit assumption that ~/.zshrc is idempotent.
8 年之前
Daniel Shahaf
62f1c108f3
tests: New test to capture off-by-ones.
Inspired by #312 .
8 年之前
m0viefreak
5fe8fd8bdc
'brackets': Fix for one-based indexing
Use correct indexing also for cursor-matchingbracket.
Fixup for 95d82568d8
8 年之前
Nils Luxton
2176692704
docs: Added style key prefix convention
Part of #306
8 年之前
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 .
8 年之前
Daniel Shahaf
fc9c892a3f
'main': Fix issue #302 , "Process substitution misparsed as redirection".
8 年之前
Daniel Shahaf
bfabffbf97
'main': Factor out common code. No functional change.
8 年之前
Daniel Shahaf
6889ff6bd2
'main': Add a regression test for issue #302 , "Process substitution misparsed as redirection".
8 年之前
Matthew Martin
9cab566f53
docs: Document installation with other plugin managers
Closes #297 .
8 年之前
Matthew Martin
bb341f186c
dev docs: Document testing quirks
8 年之前
Matthew Martin
b5955213b9
tests: Add tests for 'brackets' and 'pattern'
8 年之前
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
8 年之前
Daniel Shahaf
3176b9567c
minor: tests: Quote $BUFFER differently on output.
The new output improves readability of the 'main' highlighter's test output.
8 年之前
Daniel Shahaf
6aa57d60aa
tests: TAP support: Emit a 'description' for all test points
8 年之前
Daniel Shahaf
f83bca0847
minor: tests: Introduce a local variable. No functional change.
8 年之前
Daniel Shahaf
70b5687d66
minor: tests: Tighten up local variable scope.
8 年之前
Daniel Shahaf
21207c336a
tests: TAP compliance: Do not emit literal '#' in the 'description' part
8 年之前
Daniel Shahaf
56a867076c
tests: Followup to fd061b5730bf: quote both expected and actual output.
8 年之前
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.
8 年之前
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.
8 年之前
Matthew Martin
d3678ec7a8
tests: Remove unused_highlight
8 年之前
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.
8 年之前
Matthew Martin
ccaf6f48a1
brackets: Fix bug introduced in 95d8256
8 年之前
Matthew Martin
e05b8e88ad
'brackets': Check if brackets match on first pass
This removes the need for the typepos array.
8 年之前
Matthew Martin
95d82568d8
'brackets': Use one-based indexing
zsh arrays start at one, and this will make the next commit easier.
8 年之前
Matthew Martin
f4d3dcb42f
'brackets': Move highlight call outside conditional
8 年之前
Matthew Martin
fd84010252
'brackets': Lift local declarations from inside loops
8 年之前
Daniel Shahaf
cef49752fd
dev docs: Create HACKING.md.
Review-by: Matthew Martin
8 年之前
Daniel Shahaf
e8af14fe1f
minor: Rewrap docs for uncompiled readability.
8 年之前