Daniel Shahaf
62f1c108f3
tests: New test to capture off-by-ones.
Inspired by #312 .
8 yıl önce
m0viefreak
5fe8fd8bdc
'brackets': Fix for one-based indexing
Use correct indexing also for cursor-matchingbracket.
Fixup for 95d82568d8
8 yıl önce
Nils Luxton
2176692704
docs: Added style key prefix convention
Part of #306
8 yıl önce
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 yıl önce
Matthew Martin
9cab566f53
docs: Document installation with other plugin managers
Closes #297 .
8 yıl önce
Matthew Martin
bb341f186c
dev docs: Document testing quirks
8 yıl önce
Matthew Martin
b5955213b9
tests: Add tests for 'brackets' and 'pattern'
8 yıl önce
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 yıl önce
Daniel Shahaf
3176b9567c
minor: tests: Quote $BUFFER differently on output.
The new output improves readability of the 'main' highlighter's test output.
8 yıl önce
Daniel Shahaf
6aa57d60aa
tests: TAP support: Emit a 'description' for all test points
8 yıl önce
Daniel Shahaf
f83bca0847
minor: tests: Introduce a local variable. No functional change.
8 yıl önce
Daniel Shahaf
70b5687d66
minor: tests: Tighten up local variable scope.
8 yıl önce
Daniel Shahaf
21207c336a
tests: TAP compliance: Do not emit literal '#' in the 'description' part
8 yıl önce
Daniel Shahaf
56a867076c
tests: Followup to fd061b5730bf: quote both expected and actual output.
8 yıl önce
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 yıl önce
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 yıl önce
Matthew Martin
d3678ec7a8
tests: Remove unused_highlight
8 yıl önce
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 yıl önce
Matthew Martin
ccaf6f48a1
brackets: Fix bug introduced in 95d8256
8 yıl önce
Matthew Martin
e05b8e88ad
'brackets': Check if brackets match on first pass
This removes the need for the typepos array.
8 yıl önce
Matthew Martin
95d82568d8
'brackets': Use one-based indexing
zsh arrays start at one, and this will make the next commit easier.
8 yıl önce
Matthew Martin
f4d3dcb42f
'brackets': Move highlight call outside conditional
8 yıl önce
Matthew Martin
fd84010252
'brackets': Lift local declarations from inside loops
8 yıl önce
Daniel Shahaf
cef49752fd
dev docs: Create HACKING.md.
Review-by: Matthew Martin
8 yıl önce
Daniel Shahaf
e8af14fe1f
minor: Rewrap docs for uncompiled readability.
8 yıl önce
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 .
8 yıl önce
Matthew Martin
c346f6eb6f
docs: highlighters should use _zsh_highlight_add_highlight
8 yıl önce
Daniel Shahaf
f34714b8ee
Bump copyright years.
8 yıl önce
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.
8 yıl önce
Matthew Martin
089329660b
highlighters: Pass around the style key instead of the style itself
8 yıl önce
Matthew Martin
a830613467
tests: Specify the style key instead of the style itself
8 yıl önce
Daniel Shahaf
c54c076cfa
cleanup: Avoid colon after parameter expansion to avoid risking introducing a colon modifier.
8 yıl önce
m0viefreak
38c8fbea2d
root-highlighter: use EUID instead of id -u command
No need to fork every time.
8 yıl önce
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 .
8 yıl önce
Adam Kruszewski
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).
8 yıl önce
Daniel Shahaf
367929502f
release.md: Add a release checklist line item.
8 yıl önce
Matthew Martin
78290e043b
tests: Expect the correct style
8 yıl önce
Matthew Martin
31ac2b36a9
tests: Quote style in expected_region_highlight
8 yıl önce
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.
8 yıl önce
m0viefreak
79e4d3d124
apply suffix and isearch zle_highlights on top
8 yıl önce
Daniel Shahaf
bc7f8ea433
'main': Restore support for zsh-4.3.10 and older.
zsh older than workers/28418 (zsh revision 23bdfc7fd2
)
doesn't support the «${name:offset:length}» syntax. Therefore, use the older
«$name[start,end]» syntax instead.
Followup to 3cb58fd7d7b9e42067ffcf24892114dc2c9b26e4, "Optimization: -1 is
extra computation of string length internally".
Fixes zsh-users/zsh-syntax-highlighting#279 .
8 yıl önce
Daniel Shahaf
cb02451a4e
widget binding: Fix crucial typo in last commit.
8 yıl önce
Daniel Shahaf
11d378332e
widget binding: Further unbreak the build.
7e7e291b20
broke 'zle -C' completions, as reported in #278 just now.
8 yıl önce
Daniel Shahaf
6a634fac9f
widget binding: Properly escape widget names at definition.
Re-Fixes zsh-users/zsh-syntax-highlighting#278 .
8 yıl önce
Daniel Shahaf
47a664447c
noop: Remove stray statement terminators and line joiners.
8 yıl önce
Daniel Shahaf
261c180a36
widget binding: Unbreak the build.
The last commit inadvertently broke interactive use, although the test suite passed.
See issue #278 .
8 yıl önce
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 .
8 yıl önce
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.
8 yıl önce
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
).
8 yıl önce
Daniel Shahaf
e635f766be
docs: Clarify oh-my-zsh installation instructions.
Thanks to Andrew Janke.
Fixes zsh-users/zsh-syntax-highlighting#270 .
8 yıl önce