Compare commits
983 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
5eb677bb0f | |
|
|
e0165eaa73 | |
|
|
dcc99a8649 | |
|
|
db085e4661 | |
|
|
9bb3db7fd2 | |
|
|
bb27265aee | |
|
|
71bd576af8 | |
|
|
d59ce0fbd0 | |
|
|
e82e2d042d | |
|
|
0b5b3dcc0c | |
|
|
f8cd0b55b3 | |
|
|
1e82d8c83e | |
|
|
dd0cf649d1 | |
|
|
65071902d3 | |
|
|
143b25eb98 | |
|
|
1386f1213e | |
|
|
754cefe018 | |
|
|
75ba3d87e3 | |
|
|
b2c910a85e | |
|
|
122dc46439 | |
|
|
b828f45da6 | |
|
|
caa749d030 | |
|
|
c5ce001467 | |
|
|
5459ebcc4e | |
|
|
2cd73fcbde | |
|
|
643717ccaf | |
|
|
caeca0bf6b | |
|
|
56b4433461 | |
|
|
0ddb1a8d51 | |
|
|
c10808ad5f | |
|
|
b392045e6f | |
|
|
c7caf57ca8 | |
|
|
1a9264bc66 | |
|
|
f6a22fa842 | |
|
|
6e0e950154 | |
|
|
dffe304567 | |
|
|
f0e6a8ef5c | |
|
|
0e1bb14452 | |
|
|
894127b221 | |
|
|
ebef4e5569 | |
|
|
993a07fc7f | |
|
|
e8517244f7 | |
|
|
205bc7ea19 | |
|
|
5eb494852e | |
|
|
75c0eb0717 | |
|
|
046cb03a12 | |
|
|
1715f39a46 | |
|
|
2ebfa6a598 | |
|
|
aac09942b8 | |
|
|
62c5575848 | |
|
|
4cf464f843 | |
|
|
6d5372a937 | |
|
|
e9cad1493f | |
|
|
79b6e7e05f | |
|
|
3944a44ffe | |
|
|
34674d7860 | |
|
|
e4d1db1e2c | |
|
|
c14fcad3b0 | |
|
|
239c720dec | |
|
|
7cc6226477 | |
|
|
cba4a1bc2e | |
|
|
637e1c702e | |
|
|
2d60a47cc4 | |
|
|
00a5fd11eb | |
|
|
cdd7f899cb | |
|
|
cb33cc0081 | |
|
|
9ce3540d74 | |
|
|
d62baa50f4 | |
|
|
59cb9a560d | |
|
|
7b863fb413 | |
|
|
8a1bd7c8b6 | |
|
|
daf0d94bae | |
|
|
c28312b9d3 | |
|
|
d9a7963970 | |
|
|
810c2dcede | |
|
|
075c852924 | |
|
|
fb929edc30 | |
|
|
91d2eeaf23 | |
|
|
f6471dbec3 | |
|
|
f6f7a91818 | |
|
|
6fd92e1bbd | |
|
|
792c065acb | |
|
|
0f11d80968 | |
|
|
00c0c76550 | |
|
|
870bccf8ff | |
|
|
a238647df9 | |
|
|
f8b1470314 | |
|
|
ade4b28d2d | |
|
|
8211a95421 | |
|
|
d4df626c03 | |
|
|
8f5d74d219 | |
|
|
700c0e18fe | |
|
|
a50647e77b | |
|
|
b253a8b86a | |
|
|
4dd4797ae0 | |
|
|
5171ec524f | |
|
|
ea3ae74164 | |
|
|
41b8a74692 | |
|
|
3a4b212c7d | |
|
|
0582ea1910 | |
|
|
e65ebf0466 | |
|
|
06710f3780 | |
|
|
343ec1061f | |
|
|
b08d508cd8 | |
|
|
16d818a21f | |
|
|
f1b9fbbaf0 | |
|
|
8d32609a7b | |
|
|
f5d1be7ec2 | |
|
|
415e762ab2 | |
|
|
ccb1da4ae8 | |
|
|
96eb2e31a1 | |
|
|
291634ecfe | |
|
|
96e6cbe22f | |
|
|
2a30d4fb5a | |
|
|
90fec4d658 | |
|
|
f563780236 | |
|
|
b8c93afd34 | |
|
|
2aca4e2c02 | |
|
|
7678a8a227 | |
|
|
5d139fcd94 | |
|
|
d1802e388e | |
|
|
aecfd61bbd | |
|
|
2904e0f986 | |
|
|
d5d2f22013 | |
|
|
8eaa41431d | |
|
|
e4f24f8901 | |
|
|
1000da306a | |
|
|
b44964c545 | |
|
|
f54d829f03 | |
|
|
9e9885253a | |
|
|
3e7745ef30 | |
|
|
b0af27f25f | |
|
|
bd9094cc61 | |
|
|
c7229a000a | |
|
|
f2726d0464 | |
|
|
8184266338 | |
|
|
83ac855ceb | |
|
|
3f930fb0c1 | |
|
|
5545fb9ab2 | |
|
|
a6eb966d96 | |
|
|
c67372e96c | |
|
|
29ca0bc6c8 | |
|
|
08839bbd87 | |
|
|
e2dddb91c6 | |
|
|
cfef4f3ae0 | |
|
|
48dd47931a | |
|
|
3d81c83132 | |
|
|
3c5f63d959 | |
|
|
5a44d9f32a | |
|
|
ea7c165b59 | |
|
|
90a92b2bb8 | |
|
|
fdf23e06c7 | |
|
|
10171731f3 | |
|
|
dfc41123d7 | |
|
|
d6defe715a | |
|
|
3ff5bec82e | |
|
|
c4bb260a30 | |
|
|
9bdeb4aa4a | |
|
|
63852df983 | |
|
|
66021cf0f7 | |
|
|
0f627fdf60 | |
|
|
bdb4e8b70e | |
|
|
e6eea1f9b7 | |
|
|
99389327ae | |
|
|
e165f18c75 | |
|
|
d237a60c9b | |
|
|
2e65bb6d7d | |
|
|
61c1cfe99f | |
|
|
ea2f1060f6 | |
|
|
e79ce6afd0 | |
|
|
fb69f4ca81 | |
|
|
1024ae8177 | |
|
|
5720d87052 | |
|
|
2339ee33b9 | |
|
|
61945185ff | |
|
|
936bc251a8 | |
|
|
c699ce9a26 | |
|
|
6e1a221699 | |
|
|
9ceb7c6e7c | |
|
|
b454b596ed | |
|
|
e815d4579b | |
|
|
3174e375f4 | |
|
|
f56e3fad23 | |
|
|
62e2d05f91 | |
|
|
2cc2583f8f | |
|
|
e15781c900 | |
|
|
20d250d618 | |
|
|
c73153c6e8 | |
|
|
63bcd85dfa | |
|
|
4bbd2a3bc6 | |
|
|
241d3a92e8 | |
|
|
6243c99f41 | |
|
|
8f7e9b2af4 | |
|
|
f63f07417d | |
|
|
2331072c06 | |
|
|
9e036e0b0c | |
|
|
74c7ffc9b5 | |
|
|
8feb06a022 | |
|
|
fdf682a2f9 | |
|
|
f564d11a41 | |
|
|
8072651b6c | |
|
|
9931990b92 | |
|
|
525ba90932 | |
|
|
9134cdf8d6 | |
|
|
e94dc89606 | |
|
|
f996d83975 | |
|
|
54e1828d5c | |
|
|
c5878ae632 | |
|
|
498cc7641f | |
|
|
81267ca313 | |
|
|
bfd44f5c3f | |
|
|
3ca93f864f | |
|
|
a4525a0826 | |
|
|
e58e45273f | |
|
|
37b6f5052f | |
|
|
a3c1757e47 | |
|
|
b00be5f741 | |
|
|
b85e313bc9 | |
|
|
41d90cb5ed | |
|
|
34df84a7dd | |
|
|
1a752da1c2 | |
|
|
8e3578240c | |
|
|
edfc7dfd9b | |
|
|
9880276756 | |
|
|
027f522300 | |
|
|
619fcad067 | |
|
|
932e29a0c7 | |
|
|
ec04a20681 | |
|
|
cb8d68d00a | |
|
|
04dd78cb00 | |
|
|
4eb8a19133 | |
|
|
36a3c0f82c | |
|
|
d65f4f8a35 | |
|
|
e07c901dfd | |
|
|
3cea1434ae | |
|
|
73c89c69a2 | |
|
|
7fd44bc429 | |
|
|
ab88dfad27 | |
|
|
2b3638a211 | |
|
|
3414c7c0d2 | |
|
|
4a043b4d15 | |
|
|
dc70e89bfd | |
|
|
f729726300 | |
|
|
f490b7cb95 | |
|
|
2f4f81cab7 | |
|
|
3558306149 | |
|
|
1a55dc8fc2 | |
|
|
52ea5c686a | |
|
|
dde84e1b25 | |
|
|
0e51046b19 | |
|
|
4e92449752 | |
|
|
b73853dd96 | |
|
|
4546756500 | |
|
|
9d380805d7 | |
|
|
deee22ed42 | |
|
|
77c6bf2019 | |
|
|
27e4789439 | |
|
|
e2e97dde9c | |
|
|
9bf06c5c2a | |
|
|
dfb917020c | |
|
|
9ed2a46ed2 | |
|
|
1c6a6d92b0 | |
|
|
6b0671b63e | |
|
|
b3b6d7129f | |
|
|
9cb7e9a837 | |
|
|
cb166dcc77 | |
|
|
5012d771f3 | |
|
|
3a6f7e7bfe | |
|
|
b1f36d9c5f | |
|
|
08edf8db7f | |
|
|
6629a1f432 | |
|
|
521fedfdf5 | |
|
|
1618848df6 | |
|
|
c3293ba0d8 | |
|
|
21cdd6bc5e | |
|
|
f32d1704b1 | |
|
|
86fe054005 | |
|
|
533bfa0116 | |
|
|
2d0dddf58b | |
|
|
27fa4a6546 | |
|
|
ae5ad09cf5 | |
|
|
3ee5aa0e06 | |
|
|
eb277cdcc6 | |
|
|
71dc090d02 | |
|
|
6a310ada5b | |
|
|
c1d5790c57 | |
|
|
e9b1ce1a36 | |
|
|
68fbe1a449 | |
|
|
f02c0bf980 | |
|
|
1be58a6f45 | |
|
|
c0ad50e645 | |
|
|
8b2768ab40 | |
|
|
6f1f595e3e | |
|
|
de95d50bce | |
|
|
83862c1abb | |
|
|
ce10f20e77 | |
|
|
6647e88606 | |
|
|
b7592e581d | |
|
|
926c36c1fb | |
|
|
4952325051 | |
|
|
d5a4a6e195 | |
|
|
e209cbe61a | |
|
|
e7d3fbc50b | |
|
|
139ea2b189 | |
|
|
be3882aeb0 | |
|
|
35c8690c00 | |
|
|
b55832c5f8 | |
|
|
8e78e9dbba | |
|
|
2bd709fc28 | |
|
|
1fcd786f77 | |
|
|
369620dd2d | |
|
|
9cc0060334 | |
|
|
a88d41e095 | |
|
|
b3f66fc874 | |
|
|
83249e1b23 | |
|
|
ab4b6f5823 | |
|
|
d766243f7a | |
|
|
fd4c5db4c9 | |
|
|
650dd79d86 | |
|
|
82cf2527fc | |
|
|
972ad197c1 | |
|
|
7ba4f0f119 | |
|
|
bc3f77f719 | |
|
|
5f80147c55 | |
|
|
3e86ef59b7 | |
|
|
a109ab54f0 | |
|
|
809443f5c5 | |
|
|
abec25d013 | |
|
|
79596a84be | |
|
|
37d6108215 | |
|
|
d61ebbcbbf | |
|
|
2f3b98ff6f | |
|
|
4fb570e104 | |
|
|
693757bfd7 | |
|
|
1e34c4aa0b | |
|
|
3259fe338d | |
|
|
ba2d8fcf76 | |
|
|
9bd38c6fc0 | |
|
|
dddea5d5dd | |
|
|
9a06c28ddc | |
|
|
fd57ed94f1 | |
|
|
78b95b0695 | |
|
|
06893a3873 | |
|
|
580ccaebb8 | |
|
|
7cb5ad0f9b | |
|
|
cd1647f4d4 | |
|
|
0efad58f30 | |
|
|
864864442e | |
|
|
55f846c673 | |
|
|
3dc74b5c2c | |
|
|
e900ad8bad | |
|
|
f087f3c6e4 | |
|
|
3e6d1375c9 | |
|
|
4ce56a821e | |
|
|
44b89f3307 | |
|
|
0c9252ac69 | |
|
|
6cf522b7b3 | |
|
|
298ef6a2fa | |
|
|
d9e326b993 | |
|
|
48a20d067f | |
|
|
6539f0d419 | |
|
|
7d961ba1e6 | |
|
|
ad3a6cb3c9 | |
|
|
9870ccc505 | |
|
|
38c794a978 | |
|
|
de23e75946 | |
|
|
a3c9e7ebc7 | |
|
|
f71a17c58e | |
|
|
d0c23a68b3 | |
|
|
7388adf4e8 | |
|
|
cb8c736a56 | |
|
|
2d4fe988ba | |
|
|
8f17e4e201 | |
|
|
02f4a6b540 | |
|
|
b9d7fe5a43 | |
|
|
6898f71016 | |
|
|
df8b2fb867 | |
|
|
9d6ecea21c | |
|
|
8d4c6355e6 | |
|
|
47c2b7e185 | |
|
|
56ba7f082d | |
|
|
2cbb3fb24e | |
|
|
f265ef0b9a | |
|
|
d0fb0df4ff | |
|
|
f665eec230 | |
|
|
a868b6942e | |
|
|
b5249f17ab | |
|
|
d2594c1157 | |
|
|
66ae59eccc | |
|
|
1651137f5c | |
|
|
d4ab7e51d2 | |
|
|
38477f2a3d | |
|
|
d98622dcd0 | |
|
|
04fd6bbf53 | |
|
|
30c6e70394 | |
|
|
74a27de70d | |
|
|
85e62a8171 | |
|
|
aed99f6a3e | |
|
|
d6586e2a4f | |
|
|
31276c1b64 | |
|
|
07f259f653 | |
|
|
e27e53b1ef | |
|
|
c6e3d216ec | |
|
|
5bb5703b0d | |
|
|
dea05e44e6 | |
|
|
2f03b6d704 | |
|
|
b075147888 | |
|
|
9289a57de0 | |
|
|
c76daac095 | |
|
|
de28e20fbc | |
|
|
c05ebf762c | |
|
|
ae5b9b2dc9 | |
|
|
df431eeee8 | |
|
|
3ddb974a3d | |
|
|
b6e0aeb380 | |
|
|
4748f9bd3d | |
|
|
e3edddd8ec | |
|
|
c138123397 | |
|
|
57386f30ae | |
|
|
e1ecf950e2 | |
|
|
f46b148c52 | |
|
|
99d7235c2b | |
|
|
05a55108c9 | |
|
|
e43e4fd2c7 | |
|
|
a56c33c3be | |
|
|
005179ed8e | |
|
|
0709520597 | |
|
|
f7ac43cd49 | |
|
|
31ceaed4f4 | |
|
|
ad6261fbca | |
|
|
3a33ac1d20 | |
|
|
f3425e18fe | |
|
|
82c39716eb | |
|
|
a2e993c59f | |
|
|
bee115f797 | |
|
|
7f5e11e38b | |
|
|
78be8f611f | |
|
|
8b11ca087e | |
|
|
5694221939 | |
|
|
4c7db4e886 | |
|
|
add2ac59fc | |
|
|
6e8984e2ec | |
|
|
dbdebfaaa5 | |
|
|
bf055f7df2 | |
|
|
76d61360a7 | |
|
|
f3410c5862 | |
|
|
cf88b63523 | |
|
|
565463ca8f | |
|
|
e86f75a840 | |
|
|
22839d08ef | |
|
|
472c71c1fa | |
|
|
9616bfdb20 | |
|
|
8a93b852ca | |
|
|
932eb380e2 | |
|
|
c06e5e95dc | |
|
|
12e01336f1 | |
|
|
13d332af95 | |
|
|
57e451b531 | |
|
|
49dbb05791 | |
|
|
c0e64fe131 | |
|
|
73640b79ea | |
|
|
beae08776a | |
|
|
08d4401fae | |
|
|
3ac7d1c785 | |
|
|
9db393309e | |
|
|
c40c72c386 | |
|
|
b75169597e | |
|
|
ce592bd5c7 | |
|
|
ead8f8a1fc | |
|
|
81e89a8800 | |
|
|
dbce7317c7 | |
|
|
49cc5e25b8 | |
|
|
b1eb0358fa | |
|
|
8a0ffe1c43 | |
|
|
2fd7fbc3c2 | |
|
|
1eedb23c65 | |
|
|
3a7ddcda0b | |
|
|
8348e2d2cc | |
|
|
683321d862 | |
|
|
42d396d819 | |
|
|
47d6dac133 | |
|
|
db6cac391b | |
|
|
ee26d44de1 | |
|
|
7d3ec45249 | |
|
|
5b539663c0 | |
|
|
02a37dd919 | |
|
|
02b839550f | |
|
|
e4fffa4de5 | |
|
|
5e9b7c4650 | |
|
|
d2c8f3a56d | |
|
|
2c0c75a8ee | |
|
|
15e288a25c | |
|
|
6713727742 | |
|
|
90b09f88ee | |
|
|
9706af4b81 | |
|
|
be26017e39 | |
|
|
a9be0975c8 | |
|
|
622358f32d | |
|
|
fdca2ef714 | |
|
|
e13074528f | |
|
|
ff85c7e01b | |
|
|
84f0507cf6 | |
|
|
cc662371b1 | |
|
|
7b417be1ce | |
|
|
1f1e629290 | |
|
|
03692831ad | |
|
|
382be9096d | |
|
|
8046c33b54 | |
|
|
f16e858f0c | |
|
|
8d2955f51a | |
|
|
18e214ee5b | |
|
|
6d133a0eb0 | |
|
|
a65a07fae4 | |
|
|
e48af35753 | |
|
|
604075aa90 | |
|
|
c1a048a084 | |
|
|
6835121eaf | |
|
|
6cc861fbad | |
|
|
0458b0c16f | |
|
|
901063aa0f | |
|
|
f064b17d25 | |
|
|
4724837df0 | |
|
|
d39f83509e | |
|
|
c969a1f26a | |
|
|
d17417ec1b | |
|
|
987b743646 | |
|
|
df0f448586 | |
|
|
2181247ae1 | |
|
|
0bf9ce7ab5 | |
|
|
8652a8f4e4 | |
|
|
bdbe214453 | |
|
|
ff61a496b5 | |
|
|
572ca51b1f | |
|
|
dc1b2f6fa4 | |
|
|
25ae1c0121 | |
|
|
dcb115c74c | |
|
|
f623b07fb0 | |
|
|
ab1013ae0d | |
|
|
eeb2eadcdd | |
|
|
b07ada1255 | |
|
|
3e56294543 | |
|
|
2919679ee8 | |
|
|
ce1be4153d | |
|
|
2411195c20 | |
|
|
6a6d40208c | |
|
|
4e6f60063f | |
|
|
fb948f5331 | |
|
|
1ad5c1f40f | |
|
|
8d37377644 | |
|
|
d04c62a224 | |
|
|
26a82113b0 | |
|
|
c13ee4cf88 | |
|
|
918aa3eb88 | |
|
|
f6d45cc191 | |
|
|
ecdda36ef5 | |
|
|
7177ba005f | |
|
|
2a50614579 | |
|
|
749b30221d | |
|
|
f4d37b74cc | |
|
|
4bd30737dc | |
|
|
038409c10d | |
|
|
c948a3caa0 | |
|
|
e4352f98bb | |
|
|
9d9e9662cf | |
|
|
18517cc98e | |
|
|
459c128f43 | |
|
|
079ea39f74 | |
|
|
a9ce931439 | |
|
|
a33c72e838 | |
|
|
1f77ed8369 | |
|
|
9dcfacc4a5 | |
|
|
ac90970edc | |
|
|
f547f7768c | |
|
|
a2a899b41b | |
|
|
c41356c3f6 | |
|
|
8146d58bb2 | |
|
|
5436d3e5fc | |
|
|
3d26cb8146 | |
|
|
873b9955c7 | |
|
|
4cde79ef00 | |
|
|
9ff91eb8f0 | |
|
|
434af7b11d | |
|
|
6f149dfc5e | |
|
|
e58800158a | |
|
|
871041a939 | |
|
|
ed90f0d2c9 | |
|
|
bbaae63f2e | |
|
|
d025148858 | |
|
|
f60d9b8c36 | |
|
|
d43fe3ab70 | |
|
|
47ac611c89 | |
|
|
46441b1c0d | |
|
|
7e840ff2db | |
|
|
176a019434 | |
|
|
e4ed76b87d | |
|
|
30a29a9e31 | |
|
|
dc26731555 | |
|
|
411864d35b | |
|
|
d1666463a7 | |
|
|
dea1fedc73 | |
|
|
b56ee542d6 | |
|
|
3c43da5ffe | |
|
|
f2ba507bbc | |
|
|
28e661bbc8 | |
|
|
39a6c476dd | |
|
|
5feed23962 | |
|
|
ad522a0914 | |
|
|
462779629a | |
|
|
73cb832702 | |
|
|
be083d7f37 | |
|
|
237f89ad62 | |
|
|
835fec7f3c | |
|
|
9523d6d49c | |
|
|
aac4a44238 | |
|
|
4f49c4a35f | |
|
|
b8fa1b9dc9 | |
|
|
5efd062a4d | |
|
|
67be62107b | |
|
|
74949c2d91 | |
|
|
8d5afe47f7 | |
|
|
76ea9e1df3 | |
|
|
50fbb5f76e | |
|
|
2dce602727 | |
|
|
9396ad5c5f | |
|
|
347cf0eb06 | |
|
|
5625e30b87 | |
|
|
fed37a90ac | |
|
|
626c034c68 | |
|
|
3d74aa47e4 | |
|
|
5398949cb3 | |
|
|
035d3eb095 | |
|
|
b7e277106b | |
|
|
1495195eb5 | |
|
|
50cbdbaebc | |
|
|
242481c279 | |
|
|
cd9ec14a65 | |
|
|
24096c2e4f | |
|
|
28d7056a7a | |
|
|
1bdb88aee1 | |
|
|
d464d3857f | |
|
|
f5c44ed7a2 | |
|
|
2335986a39 | |
|
|
e060a0a1c8 | |
|
|
f3d0e141fd | |
|
|
3c90a673f6 | |
|
|
773d60c833 | |
|
|
2dff6e54ed | |
|
|
0020f592c1 | |
|
|
56e4c38ab4 | |
|
|
7d38d07255 | |
|
|
094329eb14 | |
|
|
bccc3dc269 | |
|
|
b4537a972e | |
|
|
2b303f01b6 | |
|
|
79198759b3 | |
|
|
dd51b7bebe | |
|
|
15461e7d21 | |
|
|
44ef6e38e5 | |
|
|
4afe670f7a | |
|
|
c3913e0d8e | |
|
|
4fc35362ee | |
|
|
2bb8f0703d | |
|
|
a2876fb57d | |
|
|
b2733a64da | |
|
|
2755438e80 | |
|
|
c6b6513ac0 | |
|
|
a053768627 | |
|
|
e5782e4ddf | |
|
|
8bf423d16d | |
|
|
5627fd2045 | |
|
|
987c133486 | |
|
|
a4196eda5e | |
|
|
e15a09840e | |
|
|
6f91850a01 | |
|
|
2fabf7ca64 | |
|
|
51b9d79c3b | |
|
|
0a9b347483 | |
|
|
02807f1826 | |
|
|
a8a6384356 | |
|
|
fdaeec4514 | |
|
|
4c4baede51 | |
|
|
da60234fb2 | |
|
|
51614ca2c9 | |
|
|
11c9081967 | |
|
|
c7f7d2ff16 | |
|
|
c793e0dcea | |
|
|
a3d5dfcbda | |
|
|
f91a7b885e | |
|
|
f3242cbd6a | |
|
|
b2ba91f12f | |
|
|
d1e0defceb | |
|
|
b7bb4f8657 | |
|
|
2c002f9f89 | |
|
|
757d047f09 | |
|
|
179b8e753f | |
|
|
6e2ef574c8 | |
|
|
d1c773faa7 | |
|
|
295d62ec88 | |
|
|
d711563fe1 | |
|
|
e2f863c151 | |
|
|
4ad311ec0a | |
|
|
171a4eec2d | |
|
|
a8fe22d422 | |
|
|
5bae621900 | |
|
|
9e569bb0fe | |
|
|
add6825898 | |
|
|
8013dc3b8d | |
|
|
fa57633d81 | |
|
|
0d41933c61 | |
|
|
e6fb61c42b | |
|
|
6b69389bd9 | |
|
|
3409a2e4d2 | |
|
|
53083da821 | |
|
|
95f7206a93 | |
|
|
fffe13a8fb | |
|
|
80148f6c84 | |
|
|
ba16cf2fb2 | |
|
|
3e59ab41b6 | |
|
|
d13da0cf00 | |
|
|
ee07588cfd | |
|
|
b9112aec79 | |
|
|
f3d3aaa00c | |
|
|
9a934d291e | |
|
|
750aebc553 | |
|
|
d9e07b5082 | |
|
|
da91264122 | |
|
|
e35a0b256e | |
|
|
10a596f9fd | |
|
|
4b77af73fb | |
|
|
47144ad974 | |
|
|
7fb6f99791 | |
|
|
fccf92402b | |
|
|
29b30e0ca7 | |
|
|
f4036a09ce | |
|
|
14711a51f3 | |
|
|
91fa057a39 | |
|
|
f060622dc6 | |
|
|
6cd39e7c70 | |
|
|
a5b8bc0ef0 | |
|
|
3b67e656bf | |
|
|
12b879caf7 | |
|
|
61f43255ab | |
|
|
6362c757b6 | |
|
|
d37c55c788 | |
|
|
364f206a54 | |
|
|
19acd8e844 | |
|
|
13018f3dd7 | |
|
|
0f43026bf0 | |
|
|
1082067f93 | |
|
|
ef68f50c04 | |
|
|
4832f18c50 | |
|
|
f146651913 | |
|
|
2f18ba64e3 | |
|
|
3ce01076b5 | |
|
|
def8c0da83 | |
|
|
4f5bb6cf96 | |
|
|
0ff354b44b | |
|
|
7b82b88a71 | |
|
|
ef4bfe5bcc | |
|
|
5a98cd3a10 | |
|
|
02229ebd63 | |
|
|
162c826452 | |
|
|
a00ed24ba3 | |
|
|
62f1c108f3 | |
|
|
5fe8fd8bdc | |
|
|
2176692704 | |
|
|
a7a7f8b422 | |
|
|
15db71abd0 | |
|
|
fc9c892a3f | |
|
|
bfabffbf97 | |
|
|
6889ff6bd2 | |
|
|
9cab566f53 | |
|
|
bb341f186c | |
|
|
b5955213b9 | |
|
|
f0bae44b76 | |
|
|
3176b9567c | |
|
|
6aa57d60aa | |
|
|
f83bca0847 | |
|
|
70b5687d66 | |
|
|
21207c336a | |
|
|
56a867076c | |
|
|
f73f3d53d3 | |
|
|
eaa4335c34 | |
|
|
d3678ec7a8 | |
|
|
fd061b5730 | |
|
|
ccaf6f48a1 | |
|
|
e05b8e88ad | |
|
|
95d82568d8 | |
|
|
f4d3dcb42f | |
|
|
fd84010252 | |
|
|
cef49752fd | |
|
|
e8af14fe1f | |
|
|
4da9889d15 | |
|
|
c346f6eb6f | |
|
|
f34714b8ee | |
|
|
341a3ae1f0 | |
|
|
089329660b | |
|
|
a830613467 | |
|
|
c54c076cfa | |
|
|
38c8fbea2d | |
|
|
b52a485c5c | |
|
|
d4f8edc9f3 | |
|
|
367929502f | |
|
|
78290e043b | |
|
|
31ac2b36a9 | |
|
|
bb8d325c0c | |
|
|
79e4d3d124 | |
|
|
bc7f8ea433 | |
|
|
cb02451a4e | |
|
|
11d378332e | |
|
|
6a634fac9f | |
|
|
47a664447c | |
|
|
261c180a36 | |
|
|
7e7e291b20 | |
|
|
4849ef3307 | |
|
|
4c23a2fd1b | |
|
|
e635f766be | |
|
|
18df692ae6 | |
|
|
487b122c48 | |
|
|
7044c1986e | |
|
|
bdb23d1378 | |
|
|
e500ca2462 | |
|
|
e938825a85 | |
|
|
3cb58fd7d7 | |
|
|
683f4837a0 | |
|
|
62a6be3d63 | |
|
|
451665cb2a | |
|
|
30d8f92df2 | |
|
|
282c7134e8 | |
|
|
28932316cc | |
|
|
5e4b446dee | |
|
|
9b64ad750f | |
|
|
936e2e9314 | |
|
|
ed33d2cb13 | |
|
|
268656d52b | |
|
|
38c3ac8831 | |
|
|
82f5eb17ec | |
|
|
4f3910cbba | |
|
|
73ee7c1f6c | |
|
|
48ecd29180 | |
|
|
430cf55368 | |
|
|
46cd970bc4 | |
|
|
09c4114eb9 | |
|
|
cf685a3a27 | |
|
|
69b6c4e450 | |
|
|
7338c54a25 | |
|
|
2d792b03bb | |
|
|
eee130f81d | |
|
|
952a97dbc9 | |
|
|
1f1ad09e38 | |
|
|
eb3715a56a | |
|
|
95330c691b | |
|
|
371f8183d6 | |
|
|
2e5481ab9a | |
|
|
2ed2f1e3c4 | |
|
|
b8ced86853 | |
|
|
84734ba950 | |
|
|
635a68f7b4 | |
|
|
438a94496f | |
|
|
7ee350efcd | |
|
|
22123ab622 | |
|
|
ded1c8789b | |
|
|
0b3183f6cb | |
|
|
8e115052e9 | |
|
|
5b34c23cfa | |
|
|
c575f8f375 | |
|
|
f5ca4b891b | |
|
|
51f66ae851 | |
|
|
0ab450ae47 | |
|
|
35e0b0ca69 | |
|
|
2dd6923c30 | |
|
|
6e99128987 | |
|
|
bcc9db2784 | |
|
|
b989ae23d0 | |
|
|
3f163a2fd4 | |
|
|
3bedd8571e | |
|
|
9ce97cd64d | |
|
|
49f7beecb5 | |
|
|
12097d55d1 | |
|
|
8ea392e361 | |
|
|
91e4a576fb | |
|
|
6c033e62e9 | |
|
|
e60737d320 | |
|
|
17fbcad8ac | |
|
|
ea5186543d | |
|
|
1933de83be | |
|
|
e2096f5c4e | |
|
|
29fd6ec1de | |
|
|
3ed0f7f823 | |
|
|
2dbcb575e5 | |
|
|
00de155063 | |
|
|
3bfd250cce | |
|
|
7d4252f5f5 | |
|
|
21e5e26923 | |
|
|
b1619c0013 | |
|
|
79b95c629e | |
|
|
3669d69226 | |
|
|
4fcfb15913 | |
|
|
bdc1449733 | |
|
|
1397f1bae1 | |
|
|
8f19af6b31 | |
|
|
6e3720f39d | |
|
|
28776371a0 | |
|
|
4f0c293fde | |
|
|
96ee5116b1 | |
|
|
a636527f70 | |
|
|
2b35ff1c15 | |
|
|
c015339202 | |
|
|
b5d02a2f49 | |
|
|
e1078a8b4c | |
|
|
3620ad951f | |
|
|
b285c7b821 | |
|
|
44e5323b53 | |
|
|
c0dafd1d85 | |
|
|
28abb960de | |
|
|
a59f442d2d | |
|
|
8b4adbd991 | |
|
|
6fbd2aa957 | |
|
|
9e178f9f39 | |
|
|
5a38710564 | |
|
|
d3deffbf46 | |
|
|
8ab8c815ec | |
|
|
afa6bb3882 | |
|
|
1ac39b0af1 | |
|
|
693de99a90 | |
|
|
e76f208cf8 | |
|
|
e9ceb2017e | |
|
|
2f05620b19 | |
|
|
9cb87473cc | |
|
|
f49f3bf0c0 | |
|
|
a3047a9121 | |
|
|
86e9249709 | |
|
|
0d1bfbcbfa | |
|
|
c216242b46 | |
|
|
2218e26bf8 | |
|
|
b397b12ac1 | |
|
|
87deac3062 | |
|
|
01d7eeb3c7 | |
|
|
6d6fb8b03e | |
|
|
be006aded5 | |
|
|
c6355a31b7 | |
|
|
018bc45f21 | |
|
|
2c9f8c8c95 | |
|
|
88cf98d9c4 | |
|
|
0aa6a5db78 | |
|
|
10b1da64e6 | |
|
|
80d692c400 | |
|
|
e49251b6fa | |
|
|
2080a441ac | |
|
|
59fbdda64c | |
|
|
7723edf4f5 | |
|
|
c808d2187a | |
|
|
7e6d960a08 | |
|
|
feec9f58c9 | |
|
|
ed6d229b1c | |
|
|
fb5ce43799 | |
|
|
6fe07c0961 | |
|
|
4513eaea71 | |
|
|
9816fcf055 | |
|
|
871af68082 | |
|
|
7d45f3e3ec | |
|
|
98aee7f8b9 | |
|
|
4d3da30f8b | |
|
|
557bb7e0c6 | |
|
|
57624bb9f6 | |
|
|
663c760cc9 | |
|
|
20d106bd4d | |
|
|
d66113c1ed | |
|
|
728ed66ff9 | |
|
|
8b8b19d91f | |
|
|
a18a7427fd | |
|
|
187371a459 | |
|
|
c4a9fe9379 | |
|
|
11c060ab76 | |
|
|
b2ac98b981 | |
|
|
22c8736e2b | |
|
|
d99aa58aaa | |
|
|
083c47b007 | |
|
|
30f2f1f144 | |
|
|
8631cc1061 | |
|
|
cae87016c6 | |
|
|
cac3d95269 | |
|
|
b5c30ae526 |
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Top-most editorconfig file
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
tab_width = 2
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
[Makefile]
|
||||||
|
tab_width = 8
|
||||||
|
indent_size = 8
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
---
|
||||||
|
name: Tests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.png'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.png'
|
||||||
|
schedule:
|
||||||
|
- cron: '29 7 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version:
|
||||||
|
- master
|
||||||
|
- 5.9
|
||||||
|
- 5.8.1
|
||||||
|
- 5.8
|
||||||
|
- 5.7.1
|
||||||
|
- 5.7
|
||||||
|
- 5.6.2
|
||||||
|
- 5.6.1
|
||||||
|
- 5.6
|
||||||
|
- 5.5.1
|
||||||
|
- 5.5
|
||||||
|
- 5.4.2
|
||||||
|
- 5.4.1
|
||||||
|
- 5.4
|
||||||
|
- 5.3.1
|
||||||
|
- 5.3
|
||||||
|
- 5.2
|
||||||
|
- 5.1.1
|
||||||
|
- 5.1
|
||||||
|
- 5.0.8
|
||||||
|
- 5.0.7
|
||||||
|
- 5.0.6
|
||||||
|
- 5.0.5
|
||||||
|
- 5.0.4
|
||||||
|
- 5.0.3
|
||||||
|
- 5.0.2
|
||||||
|
- 5.0.1
|
||||||
|
- 5.0.0
|
||||||
|
- 4.3.17
|
||||||
|
- 4.3.16
|
||||||
|
- 4.3.15
|
||||||
|
- 4.3.14
|
||||||
|
- 4.3.13
|
||||||
|
- 4.3.12
|
||||||
|
- 4.3.11
|
||||||
|
container:
|
||||||
|
image: ghcr.io/zsh-users/zsh:${{ matrix.version }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: install_packages bsdmainutils make procps
|
||||||
|
- run: make test
|
||||||
|
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
if: failure() && (github.repository_owner == 'zsh-users')
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Notify IRC
|
||||||
|
uses: Gottox/irc-message-action@v2
|
||||||
|
with:
|
||||||
|
channel: '#zsh-syntax-highlighting'
|
||||||
|
nickname: zsyh-gh-bot
|
||||||
|
message: '${{ github.ref }} failed tests: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
*.zwc*
|
*.zwc*
|
||||||
|
.pc/
|
||||||
|
docs/all.md
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2010-2015 zsh-syntax-highlighting contributors
|
Copyright (c) 2010-2020 zsh-syntax-highlighting contributors
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
Hacking on zsh-syntax-highlighting itself
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
This document includes information for people working on z-sy-h itself: on the
|
||||||
|
core driver (`zsh-syntax-highlighting.zsh`), on the highlighters in the
|
||||||
|
distribution, and on the test suite. It does not target third-party
|
||||||
|
highlighter authors (although they may find it an interesting read).
|
||||||
|
|
||||||
|
The `main` highlighter
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
The following function `pz` is useful when working on the `main` highlighting:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
pq() {
|
||||||
|
(( $#argv )) || return 0
|
||||||
|
print -r -l -- ${(qqqq)argv}
|
||||||
|
}
|
||||||
|
pz() {
|
||||||
|
local arg
|
||||||
|
for arg; do
|
||||||
|
pq ${(z)arg}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
It prints, for each argument, its token breakdown, similar to how the main
|
||||||
|
loop of the `main` highlighter sees it.
|
||||||
|
|
||||||
|
Testing the `brackets` highlighter
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
Since the test harness empties `ZSH_HIGHLIGHT_STYLES` and the `brackets`
|
||||||
|
highlighter interrogates `ZSH_HIGHLIGHT_STYLES` to determine how to highlight,
|
||||||
|
tests must set the `bracket-level-#` keys themselves. For example:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
|
||||||
|
BUFFER='echo ({x})'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"6 6 bracket-level-1" # (
|
||||||
|
"7 7 bracket-level-2" # {
|
||||||
|
"9 9 bracket-level-2" # }
|
||||||
|
"10 10 bracket-level-1" # )
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Testing the `pattern` and `regexp` highlighters
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
Because the `pattern` and `regexp` highlighters modifies `region_highlight`
|
||||||
|
directly instead of using `_zsh_highlight_add_highlight`, the test harness
|
||||||
|
cannot get the `ZSH_HIGHLIGHT_STYLES` keys. Therefore, when writing tests, use
|
||||||
|
the style itself as third word (cf. the
|
||||||
|
[documentation for `expected_region_highlight`](docs/highlighters.md)). For example:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||||
|
|
||||||
|
BUFFER='rm -rf /'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"1 8 fg=white,bold,bg=red" # rm -rf /
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Memos and commas
|
||||||
|
----------------
|
||||||
|
|
||||||
|
We append to `region_highlight` as follows:
|
||||||
|
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
region_highlight+=("$start $end $spec, memo=zsh-syntax-highlighting")
|
||||||
|
```
|
||||||
|
|
||||||
|
That comma is required to cause zsh 5.8 and older to ignore the memo without
|
||||||
|
ignoring the `$spec`. It's a hack, but given that no further 5.8.x patch
|
||||||
|
releases are planned, it's been deemed acceptable. See issue #418 and the
|
||||||
|
cross-referenced issues.
|
||||||
|
|
||||||
|
|
||||||
|
Miscellany
|
||||||
|
----------
|
||||||
|
|
||||||
|
If you work on the driver (`zsh-syntax-highlighting.zsh`), you may find the following zstyle useful:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
zstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-highlighting.plugin.zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
IRC channel
|
||||||
|
-----------
|
||||||
|
|
||||||
|
We're on #zsh-syntax-highlighting on Libera.Chat.
|
||||||
|
|
||||||
|
|
@ -0,0 +1,169 @@
|
||||||
|
How to install
|
||||||
|
--------------
|
||||||
|
|
||||||
|
### Using packages
|
||||||
|
|
||||||
|
First, install the package:
|
||||||
|
|
||||||
|
* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package]
|
||||||
|
* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository])
|
||||||
|
* Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository])
|
||||||
|
* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][freebsd-port])
|
||||||
|
* Gentoo: [app-shells/zsh-syntax-highlighting][gentoo-repository]
|
||||||
|
* Mac OS X / Homebrew: `brew install zsh-syntax-highlighting` ([formula][brew-package])
|
||||||
|
* NetBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][netbsd-port])
|
||||||
|
* OpenBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][openbsd-port])
|
||||||
|
* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
|
||||||
|
* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
|
||||||
|
* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository])
|
||||||
|
* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package]
|
||||||
|
|
||||||
|
[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting
|
||||||
|
[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git
|
||||||
|
[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-syntax-highlighting.rb
|
||||||
|
[debian-package]: https://packages.debian.org/zsh-syntax-highlighting
|
||||||
|
[fedora-package]: https://apps.fedoraproject.org/packages/zsh-syntax-highlighting
|
||||||
|
[fedora-package-alt]: https://bodhi.fedoraproject.org/updates/?packages=zsh-syntax-highlighting
|
||||||
|
[freebsd-port]: https://www.freshports.org/textproc/zsh-syntax-highlighting/
|
||||||
|
[gentoo-repository]: https://packages.gentoo.org/packages/app-shells/zsh-syntax-highlighting
|
||||||
|
[netbsd-port]: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/shells/zsh-syntax-highlighting/
|
||||||
|
[obs-repository]: https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&package=zsh-syntax-highlighting
|
||||||
|
[openbsd-port]: https://cvsweb.openbsd.org/ports/shells/zsh-syntax-highlighting/
|
||||||
|
[ubuntu-package]: https://launchpad.net/ubuntu/+source/zsh-syntax-highlighting
|
||||||
|
[void-package]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zsh-syntax-highlighting
|
||||||
|
|
||||||
|
See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions)
|
||||||
|
|
||||||
|
Second, enable zsh-syntax-highlighting by sourcing the script. Running this command on the terminal will add the source line to the end of your .zshrc:
|
||||||
|
|
||||||
|
* On most Linux distributions (except perhaps NixOS):
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
* NetBSD and OpenBSD:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
echo "source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
* Mac OS X / Homebrew:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
echo "source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Then restart zsh (such as by opening a new instance of your terminal emulator).
|
||||||
|
|
||||||
|
Alternatively, add the `source` command manually **at the end** of your `.zshrc`:
|
||||||
|
|
||||||
|
* On most Linux distributions (except perhaps NixOS):
|
||||||
|
`source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`
|
||||||
|
* NetBSD and OpenBSD:
|
||||||
|
`source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`
|
||||||
|
|
||||||
|
Then restart zsh.
|
||||||
|
|
||||||
|
### In your ~/.zshrc
|
||||||
|
|
||||||
|
Simply clone this repository and source the script:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||||
|
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, enable syntax highlighting in the current interactive shell:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
If `git` is not installed, download and extract a snapshot of the latest
|
||||||
|
development tree from:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
Note the `source` command must be **at the end** of `~/.zshrc`.
|
||||||
|
|
||||||
|
|
||||||
|
### With a plugin manager
|
||||||
|
|
||||||
|
Note that `zsh-syntax-highlighting` must be the last plugin sourced.
|
||||||
|
|
||||||
|
The zsh-syntax-highlighting authors recommend manual installation over the use
|
||||||
|
of a framework or plugin manager.
|
||||||
|
|
||||||
|
This list is incomplete as there are too many
|
||||||
|
[frameworks / plugin managers][framework-list] to list them all here.
|
||||||
|
|
||||||
|
[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks
|
||||||
|
|
||||||
|
#### [Antigen](https://github.com/zsh-users/antigen)
|
||||||
|
|
||||||
|
Add `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in
|
||||||
|
your `.zshrc`.
|
||||||
|
|
||||||
|
#### [Fig](https://fig.io)
|
||||||
|
|
||||||
|
Click the `Install Plugin` button on the [Fig plugin page][fig-plugin].
|
||||||
|
|
||||||
|
[fig-plugin]: https://fig.io/plugins/other/zsh-syntax-highlighting
|
||||||
|
|
||||||
|
#### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
|
||||||
|
|
||||||
|
1. Clone this repository in oh-my-zsh's plugins directory:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Activate the plugin in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=( [plugins...] zsh-syntax-highlighting)
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Restart zsh (such as by opening a new instance of your terminal emulator).
|
||||||
|
|
||||||
|
#### [Prezto](https://github.com/sorin-ionescu/prezto)
|
||||||
|
|
||||||
|
Zsh-syntax-highlighting is included with Prezto. See the
|
||||||
|
[Prezto documentation][prezto-docs] to enable and configure highlighters.
|
||||||
|
|
||||||
|
[prezto-docs]: https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting
|
||||||
|
|
||||||
|
#### [zgen](https://github.com/tarjoilija/zgen)
|
||||||
|
|
||||||
|
Add `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`.
|
||||||
|
|
||||||
|
#### [zinit](https://github.com/zdharma-continuum/zinit)
|
||||||
|
|
||||||
|
Add `zinit light zsh-users/zsh-syntax-highlighting` to the end of your
|
||||||
|
`.zshrc`.
|
||||||
|
|
||||||
|
#### [zplug](https://github.com/zplug/zplug)
|
||||||
|
|
||||||
|
Add `zplug "zsh-users/zsh-syntax-highlighting", defer:2` to your `.zshrc`.
|
||||||
|
|
||||||
|
|
||||||
|
### System-wide installation
|
||||||
|
|
||||||
|
Any of the above methods is suitable for a single-user installation,
|
||||||
|
which requires no special privileges. If, however, you desire to install
|
||||||
|
zsh-syntax-highlighting system-wide, you may do so by running
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
|
||||||
|
and directing your users to add
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
to their `.zshrc`s.
|
||||||
47
Makefile
47
Makefile
|
|
@ -2,30 +2,63 @@ NAME=zsh-syntax-highlighting
|
||||||
|
|
||||||
INSTALL?=install -c
|
INSTALL?=install -c
|
||||||
PREFIX?=/usr/local
|
PREFIX?=/usr/local
|
||||||
SHARE_DIR=$(DESTDIR)$(PREFIX)/share/$(NAME)
|
SHARE_DIR?=$(DESTDIR)$(PREFIX)/share/$(NAME)
|
||||||
|
DOC_DIR?=$(DESTDIR)$(PREFIX)/share/doc/$(NAME)
|
||||||
|
ZSH?=zsh # zsh binary to run tests with
|
||||||
|
|
||||||
# Have the default target do nothing.
|
|
||||||
all:
|
all:
|
||||||
@ :
|
cd docs && \
|
||||||
|
cp highlighters.md all.md && \
|
||||||
|
printf '\n\nIndividual highlighters documentation\n=====================================' >> all.md && \
|
||||||
|
for doc in highlighters/*.md; do printf '\n\n'; cat "$$doc"; done >> all.md
|
||||||
|
|
||||||
install:
|
install: all
|
||||||
$(INSTALL) -d $(SHARE_DIR)
|
$(INSTALL) -d $(SHARE_DIR)
|
||||||
cp -r .version zsh-syntax-highlighting.zsh highlighters $(SHARE_DIR)
|
$(INSTALL) -d $(DOC_DIR)
|
||||||
|
cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)
|
||||||
|
cp COPYING.md README.md changelog.md $(DOC_DIR)
|
||||||
|
sed -e '1s/ .*//' -e '/^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR)/README.md
|
||||||
if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
|
if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
|
||||||
git rev-parse HEAD; \
|
git rev-parse HEAD; \
|
||||||
else \
|
else \
|
||||||
cat .revision-hash; \
|
cat .revision-hash; \
|
||||||
fi > $(SHARE_DIR)/.revision-hash
|
fi > $(SHARE_DIR)/.revision-hash
|
||||||
|
:
|
||||||
|
# The [ -e ] check below is to because sh evaluates this with (the moral
|
||||||
|
# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
|
||||||
|
for dirname in highlighters highlighters/*/ ; do \
|
||||||
|
$(INSTALL) -d $(SHARE_DIR)/"$$dirname"; \
|
||||||
|
for fname in "$$dirname"/*.zsh ; do [ -e "$$fname" ] && cp "$$fname" $(SHARE_DIR)"/$$dirname"; done; \
|
||||||
|
done
|
||||||
|
cp -R docs/* $(DOC_DIR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f docs/all.md
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
@$(ZSH) -fc 'echo ZSH_PATCHLEVEL=$$ZSH_PATCHLEVEL'
|
||||||
@result=0; \
|
@result=0; \
|
||||||
for test in highlighters/*; do \
|
for test in highlighters/*; do \
|
||||||
if [ -d $$test/test-data ]; then \
|
if [ -d $$test/test-data ]; then \
|
||||||
echo "Running test $${test##*/}"; \
|
echo "Running test $${test##*/}"; \
|
||||||
zsh -f tests/test-highlighting.zsh "$${test##*/}"; \
|
env -i QUIET=$$QUIET $${TERM:+"TERM=$$TERM"} $(ZSH) -f tests/test-highlighting.zsh "$${test##*/}"; \
|
||||||
: $$(( result |= $$? )); \
|
: $$(( result |= $$? )); \
|
||||||
fi \
|
fi \
|
||||||
done; \
|
done; \
|
||||||
exit $$result
|
exit $$result
|
||||||
|
|
||||||
.PHONY: all install test
|
quiet-test:
|
||||||
|
$(MAKE) test QUIET=y
|
||||||
|
|
||||||
|
perf:
|
||||||
|
@result=0; \
|
||||||
|
for test in highlighters/*; do \
|
||||||
|
if [ -d $$test/test-data ]; then \
|
||||||
|
echo "Running test $${test##*/}"; \
|
||||||
|
$(ZSH) -f tests/test-perfs.zsh "$${test##*/}"; \
|
||||||
|
: $$(( result |= $$? )); \
|
||||||
|
fi \
|
||||||
|
done; \
|
||||||
|
exit $$result
|
||||||
|
|
||||||
|
.PHONY: all install clean test perf
|
||||||
|
|
|
||||||
118
README.md
118
README.md
|
|
@ -1,73 +1,97 @@
|
||||||
zsh-syntax-highlighting
|
zsh-syntax-highlighting [![Build Status][build-status-image]][build-status]
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
**[Fish shell](http://www.fishshell.com) like syntax highlighting for [Zsh](http://www.zsh.org).**
|
**[Fish shell][fish]-like syntax highlighting for [Zsh][zsh].**
|
||||||
|
|
||||||
|
*Requirements: zsh 4.3.11+.*
|
||||||
|
|
||||||
|
[fish]: https://fishshell.com/
|
||||||
|
[zsh]: https://www.zsh.org/
|
||||||
|
|
||||||
|
This package provides syntax highlighting for the shell zsh. It enables
|
||||||
|
highlighting of commands whilst they are typed at a zsh prompt into an
|
||||||
|
interactive terminal. This helps in reviewing commands before running
|
||||||
|
them, particularly in catching syntax errors.
|
||||||
|
|
||||||
|
Some examples:
|
||||||
|
|
||||||
|
Before: [](images/before1.png)
|
||||||
|
<br/>
|
||||||
|
After: [](images/after1.png)
|
||||||
|
|
||||||
|
Before: [](images/before2.png)
|
||||||
|
<br/>
|
||||||
|
After: [](images/after2.png)
|
||||||
|
|
||||||
|
Before: [](images/before3.png)
|
||||||
|
<br/>
|
||||||
|
After: [](images/after3.png)
|
||||||
|
|
||||||
|
Before: [](images/before4-smaller.png)
|
||||||
|
<br/>
|
||||||
|
After: [](images/after4-smaller.png)
|
||||||
|
|
||||||
*Requirements: zsh 4.3.17+.*
|
|
||||||
|
|
||||||
|
|
||||||
How to install
|
How to install
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
### Using packages
|
See [INSTALL.md](INSTALL.md).
|
||||||
|
|
||||||
* Arch Linux: [community/zsh-syntax-highlighting](https://www.archlinux.org/packages/zsh-syntax-highlighting) / [AUR/zsh-syntax-highlighting-git](https://aur.archlinux.org/packages/zsh-syntax-highlighting-git)
|
|
||||||
* Gentoo: [mv overlay](http://gpo.zugaina.org/app-shells/zsh-syntax-highlighting)
|
|
||||||
* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zsh-syntax-highlighting.rb)
|
|
||||||
|
|
||||||
### In your ~/.zshrc
|
|
||||||
|
|
||||||
* Clone this repository:
|
|
||||||
|
|
||||||
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git
|
|
||||||
|
|
||||||
(or [download a snapshot](https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz))
|
|
||||||
|
|
||||||
* Source the script **at the end** of `~/.zshrc`:
|
|
||||||
|
|
||||||
source /path/to/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
||||||
|
|
||||||
* Source `~/.zshrc` to take changes into account:
|
|
||||||
|
|
||||||
source ~/.zshrc
|
|
||||||
|
|
||||||
|
|
||||||
### With oh-my-zsh
|
|
||||||
|
|
||||||
* Download the script or clone this repository in [oh-my-zsh](http://github.com/robbyrussell/oh-my-zsh) plugins directory:
|
|
||||||
|
|
||||||
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
|
|
||||||
|
|
||||||
* Activate the plugin in `~/.zshrc`:
|
|
||||||
|
|
||||||
plugins=( [plugins...] zsh-syntax-highlighting)
|
|
||||||
|
|
||||||
* Source `~/.zshrc` to take changes into account:
|
|
||||||
|
|
||||||
source ~/.zshrc
|
|
||||||
|
|
||||||
Note that `zsh-syntax-highlighting` must be the last plugin sourced,
|
|
||||||
so make it the last element of the `$plugins` array.
|
|
||||||
|
|
||||||
FAQ
|
FAQ
|
||||||
---
|
---
|
||||||
|
|
||||||
### Why must `zsh-syntax-highlighting.zsh` be sourced at the end of the `.zshrc` file?
|
### Why must `zsh-syntax-highlighting.zsh` be sourced at the end of the `.zshrc` file?
|
||||||
|
|
||||||
`zsh-syntax-highlighting.zsh` wraps ZLE widgets. It must be sourced after all
|
zsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) and
|
||||||
custom widgets have been created (i.e., after all `zle -N` calls and after
|
computing syntax highlighting for the command-line buffer as it stands at the
|
||||||
running `compinit`). Widgets created later will work, but will not update the
|
time z-sy-h's hook is invoked.
|
||||||
|
|
||||||
|
In zsh 5.2 and older,
|
||||||
|
`zsh-syntax-highlighting.zsh` hooks into ZLE by wrapping ZLE widgets. It must
|
||||||
|
be sourced after all custom widgets have been created (i.e., after all `zle -N`
|
||||||
|
calls and after running `compinit`) in order to be able to wrap all of them.
|
||||||
|
Widgets created after z-sy-h is sourced will work, but will not update the
|
||||||
syntax highlighting.
|
syntax highlighting.
|
||||||
|
|
||||||
|
In zsh newer than 5.8 (not including 5.8 itself),
|
||||||
|
zsh-syntax-highlighting uses the `add-zle-hook-widget` facility to install
|
||||||
|
a `zle-line-pre-redraw` hook. Hooks are run in order of registration,
|
||||||
|
therefore, z-sy-h must be sourced (and register its hook) after anything else
|
||||||
|
that adds hooks that modify the command-line buffer.
|
||||||
|
|
||||||
|
### Does syntax highlighting work during incremental history search?
|
||||||
|
|
||||||
|
Highlighting the command line during an incremental history search (by default bound to
|
||||||
|
to <kbd>Ctrl+R</kbd> in zsh's emacs keymap) requires zsh 5.4 or newer.
|
||||||
|
|
||||||
|
Under zsh versions older than 5.4, the zsh-default [underlining][zshzle-Character-Highlighting]
|
||||||
|
of the matched portion of the buffer remains available, but zsh-syntax-highlighting's
|
||||||
|
additional highlighting is unavailable. (Those versions of zsh do not provide
|
||||||
|
enough information to allow computing the highlighting correctly.)
|
||||||
|
|
||||||
|
See issues [#288][i288] and [#415][i415] for details.
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
[i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288
|
||||||
|
[i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415
|
||||||
|
|
||||||
### How are new releases announced?
|
### How are new releases announced?
|
||||||
|
|
||||||
There is currently no "push" announcements channel. However, the following alternatives exist:
|
There is currently no "push" announcements channel. However, the following
|
||||||
|
alternatives exist:
|
||||||
|
|
||||||
- GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom
|
- GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom
|
||||||
- An anitya entry: https://release-monitoring.org/project/7552/
|
- An anitya entry: https://release-monitoring.org/project/7552/
|
||||||
|
|
||||||
|
|
||||||
How to tweak
|
How to tweak
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Syntax highlighting is done by pluggable highlighter scripts, see the [highlighters directory](highlighters)
|
Syntax highlighting is done by pluggable highlighter scripts. See the
|
||||||
for documentation and configuration settings.
|
[documentation on highlighters](docs/highlighters.md) for details and
|
||||||
|
configuration settings.
|
||||||
|
|
||||||
|
[build-status]: https://github.com/zsh-users/zsh-syntax-highlighting/actions
|
||||||
|
[build-status-image]: https://github.com/zsh-users/zsh-syntax-highlighting/workflows/Tests/badge.svg
|
||||||
|
|
|
||||||
828
changelog.md
828
changelog.md
|
|
@ -1,3 +1,801 @@
|
||||||
|
# Changes in HEAD
|
||||||
|
|
||||||
|
|
||||||
|
- Highlight `&>` `>&|` `>&!` `&>|` and `&>!` as redirection.
|
||||||
|
[#942]
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in 0.8.0
|
||||||
|
|
||||||
|
This is a stable bugfix and feature release. Major new features and changes include:
|
||||||
|
|
||||||
|
|
||||||
|
## Changes fixed as part of the switch to zle-line-pre-redraw
|
||||||
|
|
||||||
|
The changes in this section were fixed by switching to a `zle-line-pre-redraw`-based
|
||||||
|
implementation.
|
||||||
|
|
||||||
|
Note: The new implementation will only be used on future zsh releases,
|
||||||
|
numbered 5.8.1.1 and newer, due to interoperability issues with other plugins
|
||||||
|
(issues #418 and #579). The underlying zsh feature has been available since
|
||||||
|
zsh 5.3.
|
||||||
|
|
||||||
|
Whilst under development, the new implementation was known as the
|
||||||
|
"feature/redrawhook" topic branch.
|
||||||
|
|
||||||
|
- Fixed: Highlighting not triggered after popping a buffer from the buffer stack
|
||||||
|
(using the `push-line` widget, default binding: `M-q`)
|
||||||
|
[#40]
|
||||||
|
|
||||||
|
- Fixed: Invoking completion when there were no matches removed highlighting
|
||||||
|
[#90, #470]
|
||||||
|
|
||||||
|
- Fixed: Two successive deletes followed by a yank only yanked the latest
|
||||||
|
delete, rather than both of them
|
||||||
|
[#150, #151, #160; cf. #183]
|
||||||
|
|
||||||
|
- Presumed fixed: Completing `$(xsel)` results in an error message from `xsel`,
|
||||||
|
with pre-2017 versions of `xsel`. (For 2017 vintage and newer, see the issue
|
||||||
|
for details.)
|
||||||
|
[#154]
|
||||||
|
|
||||||
|
- Fixed: When the standard `bracketed-paste-magic` widget is in use, pastes were slow
|
||||||
|
[#295]
|
||||||
|
|
||||||
|
- Fixed: No way to prevent a widget from being wrapped
|
||||||
|
[#324]
|
||||||
|
|
||||||
|
- Fixed: No highlighting while cycling menu completion
|
||||||
|
[#375]
|
||||||
|
|
||||||
|
- Fixed: Does not coexist with the `IGNORE_EOF` option
|
||||||
|
[#377]
|
||||||
|
|
||||||
|
- Fixed: The `undefined-key` widget was wrapped
|
||||||
|
[#421]
|
||||||
|
|
||||||
|
- Fixed: Does not coexist with the standard `surround` family of widgets
|
||||||
|
[#520]
|
||||||
|
|
||||||
|
- Fixed: First completed filename doesn't get `path` highlighting
|
||||||
|
[#632]
|
||||||
|
|
||||||
|
|
||||||
|
## Other changes
|
||||||
|
|
||||||
|
- Add issue #712 to the previous release's changelog (hereinafter).
|
||||||
|
|
||||||
|
- Fix highlighting when using an alias twice inside another alias
|
||||||
|
[#769, #775]
|
||||||
|
|
||||||
|
- Remove lint warning for `env` followed by a pipe
|
||||||
|
[#797]
|
||||||
|
|
||||||
|
- Recognize `proxychains` as a precommand
|
||||||
|
[#814, #914]
|
||||||
|
|
||||||
|
- Honor shwordsplit when expanding parameters
|
||||||
|
[#687, #818]
|
||||||
|
|
||||||
|
- Skip highlighting when keys are still pending in more cases
|
||||||
|
[#835]
|
||||||
|
|
||||||
|
- Recognize `grc` as a precommand
|
||||||
|
|
||||||
|
- Recognize `torsocks` and `torift` as precommands
|
||||||
|
[#898]
|
||||||
|
|
||||||
|
- Recognize `cpulimit` as a precommand
|
||||||
|
[#897]
|
||||||
|
|
||||||
|
- Recognize `ktrace` as a precommand
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in 0.8.0-alpha1-pre-redrawhook
|
||||||
|
|
||||||
|
## Notice about an improbable-but-not-impossible forward incompatibility
|
||||||
|
|
||||||
|
Everyone can probably skip this section.
|
||||||
|
|
||||||
|
The `master` branch of zsh-syntax-highlighting uses a zsh feature that has not
|
||||||
|
yet appeared in a zsh release: the `memo=` feature, added to zsh in commit
|
||||||
|
zsh-5.8-172-gdd6e702ee (after zsh 5.8, before zsh 5.9). In the unlikely event
|
||||||
|
that this zsh feature should change in an incompatible way before the next
|
||||||
|
stable zsh release, set `zsh_highlight__memo_feature=0` in your .zshrc files to
|
||||||
|
disable use of the new feature.
|
||||||
|
|
||||||
|
z-sy-h dogfoods the new, unreleased zsh feature because that feature was
|
||||||
|
added to zsh at z-sy-h's initiative. The new feature is used in the fix
|
||||||
|
to issue #418.
|
||||||
|
|
||||||
|
|
||||||
|
## Incompatible changes:
|
||||||
|
|
||||||
|
- An unsuccessful completion (a <kbd>⮀ Tab</kbd> press that doesn't change the
|
||||||
|
command line) no longer causes highlighting to be lost. Visual feedback can
|
||||||
|
alternatively be achieved by setting the `format` zstyle under the `warnings`
|
||||||
|
tag, for example,
|
||||||
|
|
||||||
|
zstyle ':completion:*:warnings' format '%F{red}No matches%f'
|
||||||
|
|
||||||
|
Refer to the [description of the `format` style in `zshcompsys(1)`]
|
||||||
|
[zshcompsys-Standard-Styles-format].
|
||||||
|
|
||||||
|
(#90, part of #245 (feature/redrawhook))
|
||||||
|
|
||||||
|
[zshcompsys-Standard-Styles]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Standard-Styles
|
||||||
|
[zshcompsys-Standard-Styles-format]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#index-format_002c-completion-style
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Other changes:
|
||||||
|
|
||||||
|
- Document `$ZSH_HIGHLIGHT_MAXLENGTH`.
|
||||||
|
[#698]
|
||||||
|
|
||||||
|
- Optimize highlighting unquoted words (words that are not in single quotes, double quotes, backticks, or dollar-single-quotes)
|
||||||
|
[#730]
|
||||||
|
|
||||||
|
- Redirection operators (e.g., `<` and `>`) are now highlighted by default
|
||||||
|
[#646]
|
||||||
|
|
||||||
|
- Propertly terminate `noglob` scope in try/always blocks
|
||||||
|
[#577]
|
||||||
|
|
||||||
|
- Don't error out when `KSH_ARRAYS` is set in the calling scope
|
||||||
|
[#622, #689]
|
||||||
|
|
||||||
|
- Literal semicolons in array assignments (`foo=( bar ; baz )`) are now
|
||||||
|
highlighted as errors.
|
||||||
|
[3ca93f864fb6]
|
||||||
|
|
||||||
|
- Command separators in array assignments (`foo=( bar | baz )`) are now
|
||||||
|
highlighted as errors.
|
||||||
|
[#651, 81267ca3130c]
|
||||||
|
|
||||||
|
- Support parameter elision in command position (e.g., `$foo ls` where `$foo` is unset or empty)
|
||||||
|
[#667]
|
||||||
|
|
||||||
|
- Don't consider the filename in `sudo -e /path/to/file` to be a command position
|
||||||
|
[#678]
|
||||||
|
|
||||||
|
- Don't look up absolute directory names in $cdpath
|
||||||
|
[2cc2583f8f12, part of #669]
|
||||||
|
|
||||||
|
- Fix `exec 2>&1;` being highlighted as an error.
|
||||||
|
[#676]
|
||||||
|
|
||||||
|
- Fix `: $(<*)` being highlighted as globbing.
|
||||||
|
[#582]
|
||||||
|
|
||||||
|
- Fix `cat < *` being highlighting as globbing when the `MULTIOS` option is unset.
|
||||||
|
[#583]
|
||||||
|
|
||||||
|
- Fix `echo >&2` highlighting the `2` as a filename if a file by that name happened to exist
|
||||||
|
[#694, part of #645]
|
||||||
|
|
||||||
|
- Fix `echo >&-` highlighting the `-` as a filename if a file by that name happened to exist
|
||||||
|
[part of #645]
|
||||||
|
|
||||||
|
- Fix `echo >&p` highlighting the `p` as a filename if a file by that name happened to exist
|
||||||
|
[part of #645]
|
||||||
|
|
||||||
|
- Fix wrong highlighting of unquoted parameter expansions under zsh 5.2 and older
|
||||||
|
[e165f18c758e]
|
||||||
|
|
||||||
|
- Highlight global aliases
|
||||||
|
[#700]
|
||||||
|
|
||||||
|
- Highlight `: =nosuchcommand' as an error (when the `EQUALS` option hasn't been unset).
|
||||||
|
[#430]
|
||||||
|
|
||||||
|
- Highlight reserved word after assignments as errors (e.g., `foo=bar (ls;)`)
|
||||||
|
[#461]
|
||||||
|
|
||||||
|
- Correctly highlight `[[ foo && bar || baz ]]`.
|
||||||
|
|
||||||
|
- Highlight non-executable files in command position correctly (e.g., `% /etc/passwd`)
|
||||||
|
[#202, #669]
|
||||||
|
|
||||||
|
- Highlight directories in command position correctly, including `AUTO_CD` support
|
||||||
|
[#669]
|
||||||
|
|
||||||
|
- Recognize `env` as a precommand (e.g., `env FOO=bar ls`)
|
||||||
|
|
||||||
|
- Recognize `ionice` as a precommand
|
||||||
|
|
||||||
|
- Recognize `strace` as a precommand
|
||||||
|
|
||||||
|
- Fix an error message on stderr before every prompt when the `WARN_NESTED_VAR` zsh option is set:
|
||||||
|
`_zsh_highlight_main__precmd_hook:1: array parameter _zsh_highlight_main__command_type_cache set in enclosing scope in function _zsh_highlight_main__precmd_hook`
|
||||||
|
[#727, #731, #732, #733]
|
||||||
|
|
||||||
|
- Fix highlighting of alias whose definitions use a simple command terminator
|
||||||
|
(such as `;`, `|`, `&&`) before a newline
|
||||||
|
[#677; had regressed in 0.7.0]
|
||||||
|
|
||||||
|
- Highlight arithmetic expansions (e.g., `$(( 42 ))`)
|
||||||
|
[#607 #649 #704]
|
||||||
|
|
||||||
|
- Highlight the parentheses of array assignments as reserved words (`foo=( bar )`).
|
||||||
|
The `assign` style remains supported and has precedence.
|
||||||
|
[#585]
|
||||||
|
|
||||||
|
- Fix interoperability issue with other plugins that use highlighting. The fix
|
||||||
|
requires zsh 5.8.0.3 or newer. (zsh 5.8.0.2-dev from the `master` branch,
|
||||||
|
revision zsh-5.8-172-gdd6e702ee or newer is also fine.)
|
||||||
|
[#418, https://github.com/okapia/zsh-viexchange/issues/1]
|
||||||
|
|
||||||
|
- Improve performance of the `brackets` highlighter.
|
||||||
|
|
||||||
|
- Fix highlighting of pre-command redirections (e.g., the `$fn` in `<$fn cat`)
|
||||||
|
[#712]
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in version 0.7.1
|
||||||
|
|
||||||
|
- Remove out-of-date information from the 0.7.0 changelog.
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in version 0.7.0
|
||||||
|
|
||||||
|
This is a stable bugfix and feature release. Major new features and changes include:
|
||||||
|
|
||||||
|
- Add `ZSH_HIGHLIGHT_DIRS_BLACKLIST` to disable "path" and "path prefix"
|
||||||
|
highlighting for specific directories
|
||||||
|
[#379]
|
||||||
|
|
||||||
|
- Add the "regexp" highlighter, modelled after the pattern highlighter
|
||||||
|
[4e6f60063f1c]
|
||||||
|
|
||||||
|
- When a word uses globbing, only the globbing metacharacters will be highlighted as globbing:
|
||||||
|
in `: foo*bar`, only the `*` will be blue.
|
||||||
|
[e48af357532c]
|
||||||
|
|
||||||
|
- Highlight pasted quotes (e.g., `: foo"bar"`)
|
||||||
|
[dc1b2f6fa4bb]
|
||||||
|
|
||||||
|
- Highlight command substitutions (`` : `ls` ``, `: $(ls)`)
|
||||||
|
[c0e64fe13178 and parents, e86f75a840e7, et al]
|
||||||
|
|
||||||
|
- Highlight process substitutions (`: >(nl)`, `: <(pwd)`, `: =(git diff)`)
|
||||||
|
[c0e64fe13178 and parents, e86f75a840e7, et al]
|
||||||
|
|
||||||
|
- Highlight command substitutions inside double quotes (``: "`foo`"``)
|
||||||
|
[f16e858f0c83]
|
||||||
|
|
||||||
|
- Highlight many precommands (e.g., `nice`, `stdbuf`, `eatmydata`;
|
||||||
|
see `$precommand_options` in the source)
|
||||||
|
|
||||||
|
- Highlight numeric globs (e.g., `echo /lib<->`)
|
||||||
|
|
||||||
|
- Assorted improvements to aliases highlighting
|
||||||
|
(e.g.,
|
||||||
|
`alias sudo_u='sudo -u'; sudo_u jrandom ls`,
|
||||||
|
`alias x=y y=z z=nosuchcommand; x`,
|
||||||
|
`alias ls='ls -l'; \ls`)
|
||||||
|
[f3410c5862fc, 57386f30aec8, #544, and many others]
|
||||||
|
|
||||||
|
- Highlight some more syntax errors
|
||||||
|
[dea05e44e671, 298ef6a2fa30]
|
||||||
|
|
||||||
|
- New styles: named file descriptors, `RC_QUOTES`, and unclosed quotes (e.g., `echo "foo<CURSOR>`)
|
||||||
|
[38c794a978cd, 25ae1c01216c, 967335dfc5fd]
|
||||||
|
|
||||||
|
- The 'brackets' highlighting no longer treats quotes specially.
|
||||||
|
[ecdda36ef56f]
|
||||||
|
|
||||||
|
|
||||||
|
Selected bugfixes include:
|
||||||
|
|
||||||
|
- Highlight `sudo` correctly when it's not installed
|
||||||
|
[26a82113b08b]
|
||||||
|
|
||||||
|
- Handle some non-default options being set in zshrc
|
||||||
|
[b07ada1255b7, a2a899b41b8, 972ad197c13d, b3f66fc8748f]
|
||||||
|
|
||||||
|
- Fix off-by-one highlighting in vi "visual" mode (vicmd keymap)
|
||||||
|
[be3882aeb054]
|
||||||
|
|
||||||
|
- The 'yank-pop' widget is not wrapped
|
||||||
|
[#183]
|
||||||
|
|
||||||
|
|
||||||
|
Known issues include:
|
||||||
|
|
||||||
|
- A multiline alias that uses a simple command terminator (such as `;`, `|`, `&&`)
|
||||||
|
before a newline will incorrectly be highlighted as an error. See issue #677
|
||||||
|
for examples and workarounds.
|
||||||
|
[#677]
|
||||||
|
[UPDATE: Fixed in 0.8.0]
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in version 0.6.0
|
||||||
|
|
||||||
|
This is a stable release, featuring bugfixes and minor improvements.
|
||||||
|
|
||||||
|
|
||||||
|
## Performance improvements:
|
||||||
|
|
||||||
|
(none)
|
||||||
|
|
||||||
|
|
||||||
|
## Added highlighting of:
|
||||||
|
|
||||||
|
- The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting].
|
||||||
|
(79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support)
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
||||||
|
- Possible history expansions in double-quoted strings.
|
||||||
|
(76ea9e1df316)
|
||||||
|
|
||||||
|
- Mismatched `if`/`then`/`elif`/`else`/`fi`.
|
||||||
|
(73cb83270262)
|
||||||
|
|
||||||
|
|
||||||
|
## Fixed highlighting of:
|
||||||
|
|
||||||
|
- A comment line followed by a non-comment line.
|
||||||
|
(#385, 9396ad5c5f9c)
|
||||||
|
|
||||||
|
- An unquoted `$*` (expands to the positional parameters).
|
||||||
|
(237f89ad629f)
|
||||||
|
|
||||||
|
- history-incremental-pattern-search-backward under zsh 5.3.1.
|
||||||
|
(#407, #415, 462779629a0c)
|
||||||
|
|
||||||
|
|
||||||
|
## API changes (for highlighter authors):
|
||||||
|
|
||||||
|
(none)
|
||||||
|
|
||||||
|
|
||||||
|
## Developer-visible changes:
|
||||||
|
|
||||||
|
- tests: Set the `ALIAS_FUNC_DEF` option for zsh 5.4 compatibility.
|
||||||
|
(9523d6d49cb3)
|
||||||
|
|
||||||
|
|
||||||
|
## Other changes:
|
||||||
|
|
||||||
|
- docs: Added before/after screenshots.
|
||||||
|
(cd9ec14a65ec..b7e277106b49)
|
||||||
|
|
||||||
|
- docs: Link Fedora package.
|
||||||
|
(3d74aa47e4a7, 5feed23962df)
|
||||||
|
|
||||||
|
- docs: Link FreeBSD port.
|
||||||
|
(626c034c68d7)
|
||||||
|
|
||||||
|
- docs: Link OpenSUSE Build Service packages
|
||||||
|
(#419, dea1fedc7358)
|
||||||
|
|
||||||
|
- Prevent user-defined aliases from taking effect in z-sy-h's own code.
|
||||||
|
(#390, 2dce602727d7, 8d5afe47f774; and #392, #395, b8fa1b9dc954)
|
||||||
|
|
||||||
|
- docs: Update zplug installation instructions.
|
||||||
|
(#399, 4f49c4a35f17)
|
||||||
|
|
||||||
|
- Improve "unhandled ZLE widget 'foo'" error message.
|
||||||
|
(#409, be083d7f3710)
|
||||||
|
|
||||||
|
- Fix printing of "failed loading highlighters" error message.
|
||||||
|
(#426, ad522a091429)
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in version 0.5.0
|
||||||
|
|
||||||
|
|
||||||
|
## Performance improvements:
|
||||||
|
|
||||||
|
We thank Sebastian Gniazdowski and "m0viefreak" for significant contributions
|
||||||
|
in this area.
|
||||||
|
|
||||||
|
- Optimize string operations in the `main` (default) highlighter.
|
||||||
|
(#372/3cb58fd7d7b9, 02229ebd6328, ef4bfe5bcc14, #372/c6b6513ac0d6, #374/15461e7d21c3)
|
||||||
|
|
||||||
|
- Command word highlighting: Use the `zsh/parameter` module to avoid forks.
|
||||||
|
Memoize (cache) the results.
|
||||||
|
(#298, 3ce01076b521, 2f18ba64e397, 12b879caf7a6; #320, 3b67e656bff5)
|
||||||
|
|
||||||
|
- Avoid forks in the driver and in the `root` highlighter.
|
||||||
|
(b9112aec798a, 38c8fbea2dd2)
|
||||||
|
|
||||||
|
|
||||||
|
## Added highlighting of:
|
||||||
|
|
||||||
|
- `pkexec` (a precommand).
|
||||||
|
(#248, 4f3910cbbaa5)
|
||||||
|
|
||||||
|
- Aliases that cannot be defined normally nor invoked normally (highlighted as an error).
|
||||||
|
(#263 (in part), 28932316cca6)
|
||||||
|
|
||||||
|
- Path separators (`/`) — the default behaviour remains to highlight path separators
|
||||||
|
and path components the same way.
|
||||||
|
(#136, #260, 6cd39e7c70d3, 9a934d291e7c, f3d3aaa00cc4)
|
||||||
|
|
||||||
|
- Assignments to individual positional arguments (`42=foo` to assign to `$42`).
|
||||||
|
(f4036a09cee3)
|
||||||
|
|
||||||
|
- Linewise region (the `visual-line-mode` widget, bound to `V` in zsh's `vi` keymap).
|
||||||
|
(#267, a7a7f8b42280, ee07588cfd9b)
|
||||||
|
|
||||||
|
- Command-lines recalled by `isearch` mode; requires zsh≥5.3.
|
||||||
|
(#261 (in part); #257; 4ad311ec0a68)
|
||||||
|
|
||||||
|
- Command-lines whilst the `IGNORE_BRACES` or `IGNORE_CLOSE_BRACES` option is in effect.
|
||||||
|
(a8a6384356af, 02807f1826a5)
|
||||||
|
|
||||||
|
- Mismatched parentheses and braces (in the `main` highlighter).
|
||||||
|
(51b9d79c3bb6, 2fabf7ca64b7, a4196eda5e6f, and others)
|
||||||
|
|
||||||
|
- Mismatched `do`/`done` keywords.
|
||||||
|
(b2733a64da93)
|
||||||
|
|
||||||
|
- Mismatched `foreach`/`end` keywords.
|
||||||
|
(#96, 2bb8f0703d8f)
|
||||||
|
|
||||||
|
- In Bourne-style function definitions, when the `MULTI_FUNC_DEF` option is set
|
||||||
|
(which is the default), highlight the first word in the function body as
|
||||||
|
a command word: `f() { g "$@" }`.
|
||||||
|
(6f91850a01e1)
|
||||||
|
|
||||||
|
- `always` blocks.
|
||||||
|
(#335, e5782e4ddfb6)
|
||||||
|
|
||||||
|
- Command substitutions inside double quotes, `"$(echo foo)"`.
|
||||||
|
(#139 (in part), c3913e0d8ead)
|
||||||
|
|
||||||
|
- Non-alphabetic parameters inside double quotes (`"$$"`, `"$#"`, `"$*"`, `"$@"`, `"$?"`, `"$-"`).
|
||||||
|
(4afe670f7a1b, 44ef6e38e5a7)
|
||||||
|
|
||||||
|
- Command words from future versions of zsh (forward compatibly).
|
||||||
|
This also adds an `arg0` style that all other command word styles fall back to.
|
||||||
|
(b4537a972eed, bccc3dc26943)
|
||||||
|
|
||||||
|
- Escaped history expansions inside double quotes: `: "\!"`
|
||||||
|
(28d7056a7a06, et seq)
|
||||||
|
|
||||||
|
|
||||||
|
## Fixed highlighting of:
|
||||||
|
|
||||||
|
- Command separator tokens in syntactically-invalid positions.
|
||||||
|
(09c4114eb980)
|
||||||
|
|
||||||
|
- Redirections with a file descriptor number at command word.
|
||||||
|
(#238 (in part), 73ee7c1f6c4a)
|
||||||
|
|
||||||
|
- The `select` prompt, `$PS3`.
|
||||||
|
(#268, 451665cb2a8b)
|
||||||
|
|
||||||
|
- Values of variables in `vared`.
|
||||||
|
(e500ca246286)
|
||||||
|
|
||||||
|
- `!` as an argument (neither a history expansion nor a reserved word).
|
||||||
|
(4c23a2fd1b90)
|
||||||
|
|
||||||
|
- "division by zero" error under the `brackets` highlighter when `$ZSH_HIGHLIGHT_STYLES` is empty.
|
||||||
|
(f73f3d53d3a6)
|
||||||
|
|
||||||
|
- Process substitutions, `<(pwd)` and `>(wc -l)`.
|
||||||
|
(#302, 6889ff6bd2ad, bfabffbf975c, fc9c892a3f15)
|
||||||
|
|
||||||
|
- The non-`SHORT_LOOPS` form of `repeat` loops: `repeat 42; do true; done`.
|
||||||
|
(#290, 4832f18c50a5, ef68f50c048f, 6362c757b6f7)
|
||||||
|
|
||||||
|
- Broken symlinks (are now highlighted as files).
|
||||||
|
(#342, 95f7206a9373, 53083da8215e)
|
||||||
|
|
||||||
|
- Lines accepted from `isearch` mode.
|
||||||
|
(#284; #257, #259, #288; 5bae6219008b, a8fe22d42251)
|
||||||
|
|
||||||
|
- Work around upstream bug that triggered when the command word was a relative
|
||||||
|
path, that when interpreted relative to a $PATH directory denoted a command;
|
||||||
|
the effect of that upstream bug was that the relative path was cached as
|
||||||
|
a "valid external command name".
|
||||||
|
(#354, #355, 51614ca2c994, fdaeec45146b, 7d38d07255e4;
|
||||||
|
upstream fix slated to be released in 5.3 (workers/39104))
|
||||||
|
|
||||||
|
- After accepting a line with the cursor on a bracket, the matching bracket
|
||||||
|
of the bracket under the cursor no longer remains highlighted (with the
|
||||||
|
`brackets` highlighter).
|
||||||
|
(4c4baede519a)
|
||||||
|
|
||||||
|
- The first word on a new line within an array assignment or initialization is no
|
||||||
|
longer considered a command position.
|
||||||
|
(8bf423d16d46)
|
||||||
|
|
||||||
|
- Subshells that end at command position, `(A=42)`, `(true;)`.
|
||||||
|
(#231, 7fb6f9979121; #344, 4fc35362ee5a)
|
||||||
|
|
||||||
|
- Command word after array assignment, `a=(lorem ipsum) pwd`.
|
||||||
|
(#330, 7fb6f9979121)
|
||||||
|
|
||||||
|
|
||||||
|
## API changes (for highlighter authors):
|
||||||
|
|
||||||
|
- New interface `_zsh_highlight_add_highlight`.
|
||||||
|
(341a3ae1f015, c346f6eb6fb6)
|
||||||
|
|
||||||
|
- tests: Specify the style key, not its value, in test expectations.
|
||||||
|
(a830613467af, fd061b5730bf, eaa4335c3441, among others)
|
||||||
|
|
||||||
|
- Module author documentation improvements.
|
||||||
|
(#306 (in part), 217669270418, 0ff354b44b6e, 80148f6c8402, 364f206a547f, and others)
|
||||||
|
|
||||||
|
- The driver no longer defines a `_zsh_highlight_${highlighter}_highlighter_cache`
|
||||||
|
variable, which is in the highlighters' namespace.
|
||||||
|
(3e59ab41b6b8, 80148f6c8402, f91a7b885e7d)
|
||||||
|
|
||||||
|
- Rename highlighter entry points. The old names remain supported for
|
||||||
|
backwards compatibility.
|
||||||
|
(a3d5dfcbdae9, c793e0dceab1)
|
||||||
|
|
||||||
|
- tests: Add the "NONE" expectation.
|
||||||
|
(4da9889d1545, 13018f3dd735, d37c55c788cd)
|
||||||
|
|
||||||
|
- tests: consider a test that writes to stderr to have failed.
|
||||||
|
(#291, 1082067f9315)
|
||||||
|
|
||||||
|
|
||||||
|
## Developer-visible changes:
|
||||||
|
|
||||||
|
- Add `make quiet-test`.
|
||||||
|
(9b64ad750f35)
|
||||||
|
|
||||||
|
- test harness: Better quote replaceables in error messages.
|
||||||
|
(30d8f92df225)
|
||||||
|
|
||||||
|
- test harness: Fix exit code for XPASS.
|
||||||
|
(bb8d325c0cbd)
|
||||||
|
|
||||||
|
- Create [HACKING.md](HACKING.md).
|
||||||
|
(cef49752fd0e)
|
||||||
|
|
||||||
|
- tests: Emit a description for PASS test points.
|
||||||
|
(6aa57d60aa64, f0bae44b76dd)
|
||||||
|
|
||||||
|
- tests: Create a script that generates a test file.
|
||||||
|
(8013dc3b8db6, et seq; `tests/generate.zsh`)
|
||||||
|
|
||||||
|
|
||||||
|
## Other changes:
|
||||||
|
|
||||||
|
- Under zsh≤5.2, widgets whose names start with a `_` are no longer excluded
|
||||||
|
from highlighting.
|
||||||
|
(ed33d2cb1388; reverts part of 186d80054a40 which was for #65)
|
||||||
|
|
||||||
|
- Under zsh≤5.2, widgets implemented by a function named after the widget are
|
||||||
|
no longer excluded from highlighting.
|
||||||
|
(487b122c480d; reverts part of 776453cb5b69)
|
||||||
|
|
||||||
|
- Under zsh≤5.2, shell-unsafe widget names can now be wrapped.
|
||||||
|
(#278, 6a634fac9fb9, et seq)
|
||||||
|
|
||||||
|
- Correct some test expectations.
|
||||||
|
(78290e043bc5)
|
||||||
|
|
||||||
|
- `zsh-syntax-highlighting.plugin.zsh`: Convert from symlink to plain file
|
||||||
|
for msys2 compatibility.
|
||||||
|
(#292, d4f8edc9f3ad)
|
||||||
|
|
||||||
|
- Document installation under some plugin managers.
|
||||||
|
(e635f766bef9, 9cab566f539b)
|
||||||
|
|
||||||
|
- Don't leak the `PATH_DIRS` option.
|
||||||
|
(7b82b88a7166)
|
||||||
|
|
||||||
|
- Don't require the `FUNCTION_ARGZERO` option to be set.
|
||||||
|
(#338, 750aebc553f2)
|
||||||
|
|
||||||
|
- Under zsh≤5.2, support binding incomplete/nonexistent widgets.
|
||||||
|
(9e569bb0fe04, part of #288)
|
||||||
|
|
||||||
|
- Make the driver reentrant, fixing possibility of infinite recursion
|
||||||
|
under zsh≤5.2 under interaction with theoretical third-party code.
|
||||||
|
(#305, d711563fe1bf, 295d62ec888d, f3242cbd6aba)
|
||||||
|
|
||||||
|
- Fix warnings when `WARN_CREATE_GLOBAL` is set prior to sourcing zsh-syntax-highlighting.
|
||||||
|
(z-sy-h already sets `WARN_CREATE_GLOBAL` internally.)
|
||||||
|
(da60234fb236)
|
||||||
|
|
||||||
|
- Warn only once, rather than once per keypress, when a highlighter is unavailable.
|
||||||
|
(0a9b347483ae)
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in version 0.4.1
|
||||||
|
|
||||||
|
## Fixes:
|
||||||
|
|
||||||
|
- Arguments to widgets were not properly dash-escaped. Only matters for widgets
|
||||||
|
that take arguments (i.e., that are invoked as `zle ${widget} -- ${args}`).
|
||||||
|
(282c7134e8ac, reverts c808d2187a73)
|
||||||
|
|
||||||
|
|
||||||
|
# Changes in version 0.4.0
|
||||||
|
|
||||||
|
|
||||||
|
## Added highlighting of:
|
||||||
|
|
||||||
|
- incomplete sudo commands
|
||||||
|
(a3047a912100, 2f05620b19ae)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
sudo;
|
||||||
|
sudo -u;
|
||||||
|
```
|
||||||
|
|
||||||
|
- command words following reserved words
|
||||||
|
(#207, #222, b397b12ac139 et seq, 6fbd2aa9579b et seq, 8b4adbd991b0)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
if ls; then ls; else ls; fi
|
||||||
|
repeat 10 do ls; done
|
||||||
|
```
|
||||||
|
|
||||||
|
(The `ls` are now highlighted as a command.)
|
||||||
|
|
||||||
|
- comments (when `INTERACTIVE_COMMENTS` is set)
|
||||||
|
(#163, #167, 693de99a9030)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
echo Hello # comment
|
||||||
|
```
|
||||||
|
|
||||||
|
- closing brackets of arithmetic expansion, subshells, and blocks
|
||||||
|
(#226, a59f442d2d34, et seq)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
(( foo ))
|
||||||
|
( foo )
|
||||||
|
{ foo }
|
||||||
|
```
|
||||||
|
|
||||||
|
- command names enabled by the `PATH_DIRS` option
|
||||||
|
(#228, 96ee5116b182)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
# When ~/bin/foo/bar exists, is executable, ~/bin is in $PATH,
|
||||||
|
# and 'setopt PATH_DIRS' is in effect
|
||||||
|
foo/bar
|
||||||
|
```
|
||||||
|
|
||||||
|
- parameter expansions with braces inside double quotes
|
||||||
|
(#186, 6e3720f39d84)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
echo "${foo}"
|
||||||
|
```
|
||||||
|
|
||||||
|
- parameter expansions in command word
|
||||||
|
(#101, 4fcfb15913a2)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
x=/bin/ls
|
||||||
|
$x -l
|
||||||
|
```
|
||||||
|
|
||||||
|
- the command separators '\|&', '&!', '&\|'
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
view file.pdf &! ls
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Fixed highlighting of:
|
||||||
|
|
||||||
|
- precommand modifiers at non-command-word position
|
||||||
|
(#209, 2c9f8c8c95fa)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ls command foo
|
||||||
|
```
|
||||||
|
|
||||||
|
- sudo commands with infix redirections
|
||||||
|
(#221, be006aded590, 86e924970911)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
sudo -u >/tmp/foo.out user ls
|
||||||
|
```
|
||||||
|
|
||||||
|
- subshells; anonymous functions
|
||||||
|
(#166, #194, 0d1bfbcbfa67, 9e178f9f3948)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
(true)
|
||||||
|
() { true }
|
||||||
|
```
|
||||||
|
|
||||||
|
- parameter assignment statements with no command
|
||||||
|
(#205, 01d7eeb3c713)
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
A=1;
|
||||||
|
```
|
||||||
|
|
||||||
|
(The semicolon used to be highlighted as a mistake)
|
||||||
|
|
||||||
|
- cursor highlighter: Remove the cursor highlighting when accepting a line.
|
||||||
|
(#109, 4f0c293fdef0)
|
||||||
|
|
||||||
|
|
||||||
|
## Removed features:
|
||||||
|
|
||||||
|
- Removed highlighting of approximate paths (`path_approx`).
|
||||||
|
(#187, 98aee7f8b9a3)
|
||||||
|
|
||||||
|
|
||||||
|
## Other changes:
|
||||||
|
|
||||||
|
- main highlighter refactored to use states rather than booleans.
|
||||||
|
(2080a441ac49, et seq)
|
||||||
|
|
||||||
|
- Fix initialization when sourcing `zsh-syntax-highlighting.zsh` via a symlink
|
||||||
|
(083c47b00707)
|
||||||
|
|
||||||
|
- docs: Add screenshot.
|
||||||
|
(57624bb9f64b)
|
||||||
|
|
||||||
|
- widgets wrapping: Don't add '--' when invoking widgets.
|
||||||
|
(c808d2187a73) [_reverted in 0.4.1_]
|
||||||
|
|
||||||
|
- Refresh highlighting upon `accept-*` widgets (`accept-line` et al).
|
||||||
|
(59fbdda64c21)
|
||||||
|
|
||||||
|
- Stop leaking match/mbegin/mend to global scope (thanks to upstream
|
||||||
|
`WARN_CREATE_GLOBAL` improvements).
|
||||||
|
(d3deffbf46a4)
|
||||||
|
|
||||||
|
- 'make install': Permit setting `$(SHARE_DIR)` from the environment.
|
||||||
|
(e1078a8b4cf1)
|
||||||
|
|
||||||
|
- driver: Tolerate KSH_ARRAYS being set in the calling context.
|
||||||
|
(#162, 8f19af6b319d)
|
||||||
|
|
||||||
|
- 'make install': Install documentation fully and properly.
|
||||||
|
(#219, b1619c001390, et seq)
|
||||||
|
|
||||||
|
- docs: Improve 'main' highlighter's documentation.
|
||||||
|
(00de155063f5, 7d4252f5f596)
|
||||||
|
|
||||||
|
- docs: Moved to a new docs/ tree; assorted minor updates
|
||||||
|
(c575f8f37567, 5b34c23cfad5, et seq)
|
||||||
|
|
||||||
|
- docs: Split README.md into INSTALL.md
|
||||||
|
(0b3183f6cb9a)
|
||||||
|
|
||||||
|
- driver: Report `$ZSH_HIGHLIGHT_REVISION` when running from git
|
||||||
|
(84734ba95026)
|
||||||
|
|
||||||
|
|
||||||
|
## Developer-visible changes:
|
||||||
|
|
||||||
|
- Test harness converted to [TAP](https://testanything.org/tap-specification.html) format
|
||||||
|
(d99aa58aaaef, et seq)
|
||||||
|
|
||||||
|
- Run each test in a separate subprocess, isolating them from each other
|
||||||
|
(d99aa58aaaef, et seq)
|
||||||
|
|
||||||
|
- Fix test failure with nonexisting $HOME
|
||||||
|
(#216, b2ac98b98150)
|
||||||
|
|
||||||
|
- Test output is now colorized.
|
||||||
|
(4d3da30f8b72, 6fe07c096109)
|
||||||
|
|
||||||
|
- Document `make install`
|
||||||
|
(a18a7427fd2c)
|
||||||
|
|
||||||
|
- tests: Allow specifying the zsh binary to use.
|
||||||
|
(557bb7e0c6a0)
|
||||||
|
|
||||||
|
- tests: Add 'make perf' target
|
||||||
|
(4513eaea71d7)
|
||||||
|
|
||||||
|
- tests: Run each test in a sandbox directory
|
||||||
|
(c01533920245)
|
||||||
|
|
||||||
|
|
||||||
# Changes in version 0.3.0
|
# Changes in version 0.3.0
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5,69 +803,95 @@
|
||||||
|
|
||||||
- suffix aliases (requires zsh 5.1.1 or newer):
|
- suffix aliases (requires zsh 5.1.1 or newer):
|
||||||
|
|
||||||
|
```zsh
|
||||||
alias -s png=display
|
alias -s png=display
|
||||||
foo.png
|
foo.png
|
||||||
|
```
|
||||||
|
|
||||||
- prefix redirections:
|
- prefix redirections:
|
||||||
|
|
||||||
|
```zsh
|
||||||
<foo.txt cat
|
<foo.txt cat
|
||||||
|
```
|
||||||
|
|
||||||
- redirection operators:
|
- redirection operators:
|
||||||
|
|
||||||
|
```zsh
|
||||||
echo > foo.txt
|
echo > foo.txt
|
||||||
|
```
|
||||||
|
|
||||||
- arithmetic evaluations:
|
- arithmetic evaluations:
|
||||||
|
|
||||||
|
```zsh
|
||||||
(( 42 ))
|
(( 42 ))
|
||||||
|
```
|
||||||
|
|
||||||
- $'' strings, including \x/\octal/\u/\U escapes
|
- $'' strings, including \x/\octal/\u/\U escapes
|
||||||
|
|
||||||
|
```zsh
|
||||||
: $'foo\u0040bar'
|
: $'foo\u0040bar'
|
||||||
|
```
|
||||||
|
|
||||||
- multiline strings:
|
- multiline strings:
|
||||||
|
|
||||||
|
```zsh
|
||||||
% echo "line 1
|
% echo "line 1
|
||||||
line 2"
|
line 2"
|
||||||
|
```
|
||||||
|
|
||||||
- string literals that haven't been finished:
|
- string literals that haven't been finished:
|
||||||
|
|
||||||
|
```zsh
|
||||||
% echo "Hello, world
|
% echo "Hello, world
|
||||||
|
```
|
||||||
- command words that involve tilde expansion:
|
- command words that involve tilde expansion:
|
||||||
|
|
||||||
|
```zsh
|
||||||
% ~/bin/foo
|
% ~/bin/foo
|
||||||
|
```
|
||||||
|
|
||||||
## Fixed highlighting of:
|
## Fixed highlighting of:
|
||||||
|
|
||||||
- quoted command words:
|
- quoted command words:
|
||||||
|
|
||||||
|
```zsh
|
||||||
% \ls
|
% \ls
|
||||||
|
```
|
||||||
|
|
||||||
- backslash escapes in "" strings:
|
- backslash escapes in "" strings:
|
||||||
|
|
||||||
|
```zsh
|
||||||
% echo "\x41"
|
% echo "\x41"
|
||||||
|
```
|
||||||
|
|
||||||
- noglob after command separator:
|
- noglob after command separator:
|
||||||
|
|
||||||
|
```zsh
|
||||||
% :; noglob echo *
|
% :; noglob echo *
|
||||||
|
```
|
||||||
|
|
||||||
- glob after command separator, when the first command starts with 'noglob':
|
- glob after command separator, when the first command starts with 'noglob':
|
||||||
|
|
||||||
|
```zsh
|
||||||
% noglob true; echo *
|
% noglob true; echo *
|
||||||
|
```
|
||||||
|
|
||||||
- the region (vi visual mode / set-mark-command) (issue #165)
|
- the region (vi visual mode / set-mark-command) (issue #165)
|
||||||
|
|
||||||
- redirection and command separators that would be highlighted as `path_approx`
|
- redirection and command separators that would be highlighted as `path_approx`
|
||||||
|
|
||||||
|
```zsh
|
||||||
% echo foo;‸
|
% echo foo;‸
|
||||||
% echo <‸
|
% echo <‸
|
||||||
|
```
|
||||||
|
|
||||||
(where `‸` represents the cursor location)
|
(where `‸` represents the cursor location)
|
||||||
|
|
||||||
- escaped globbing (outside quotes)
|
- escaped globbing (outside quotes)
|
||||||
|
|
||||||
|
```zsh
|
||||||
% echo \*
|
% echo \*
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Other changes:
|
## Other changes:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
zsh-syntax-highlighting / highlighters
|
||||||
|
======================================
|
||||||
|
|
||||||
|
Syntax highlighting is done by pluggable highlighters:
|
||||||
|
|
||||||
|
* `main` - the base highlighter, and the only one [active by default][main].
|
||||||
|
* `brackets` - [matches brackets][brackets] and parenthesis.
|
||||||
|
* `pattern` - matches [user-defined patterns][pattern].
|
||||||
|
* `regexp` - matches [user-defined regular expressions][regexp].
|
||||||
|
* `cursor` - matches [the cursor position][cursor].
|
||||||
|
* `root` - highlights the whole command line [if the current user is root][root].
|
||||||
|
* `line` - applied to [the whole command line][line].
|
||||||
|
|
||||||
|
[main]: highlighters/main.md
|
||||||
|
[brackets]: highlighters/brackets.md
|
||||||
|
[pattern]: highlighters/pattern.md
|
||||||
|
[regexp]: highlighters/regexp.md
|
||||||
|
[cursor]: highlighters/cursor.md
|
||||||
|
[root]: highlighters/root.md
|
||||||
|
[line]: highlighters/line.md
|
||||||
|
|
||||||
|
|
||||||
|
Highlighter-independent settings
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
By default, all command lines are highlighted. However, it is possible to
|
||||||
|
prevent command lines longer than a fixed number of characters from being
|
||||||
|
highlighted by setting the variable `${ZSH_HIGHLIGHT_MAXLENGTH}` to the maximum
|
||||||
|
length (in characters) of command lines to be highlighter. This is useful when
|
||||||
|
editing very long command lines (for example, with the [`fned`][fned] utility
|
||||||
|
function). Example:
|
||||||
|
|
||||||
|
[fned]: https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#index-zed
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_MAXLENGTH=512
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
How to activate highlighters
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array.
|
||||||
|
By default `ZSH_HIGHLIGHT_HIGHLIGHTERS` is `(main)`. For example to activate
|
||||||
|
`brackets`, `pattern`, and `cursor` highlighters, in `~/.zshrc` do:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets pattern cursor)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
How to tweak highlighters
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Highlighters look up styles from the `ZSH_HIGHLIGHT_STYLES` associative array.
|
||||||
|
Navigate into the [individual highlighters' documentation](highlighters/) to
|
||||||
|
see what styles (keys) each highlighter defines; the syntax for values is the
|
||||||
|
same as the syntax of "types of highlighting" of the zsh builtin
|
||||||
|
`$zle_highlight` array, which is documented in [the `zshzle(1)` manual
|
||||||
|
page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
||||||
|
Some highlighters support additional configuration parameters; see each
|
||||||
|
highlighter's documentation for details and examples.
|
||||||
|
|
||||||
|
|
||||||
|
How to implement a new highlighter
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
To create your own `acme` highlighter:
|
||||||
|
|
||||||
|
* Create your script at
|
||||||
|
`highlighters/acme/acme-highlighter.zsh`.
|
||||||
|
|
||||||
|
* Implement the `_zsh_highlight_highlighter_acme_predicate` function.
|
||||||
|
This function must return 0 when the highlighter needs to be called and
|
||||||
|
non-zero otherwise, for example:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
_zsh_highlight_highlighter_acme_predicate() {
|
||||||
|
# Call this highlighter in SVN working copies
|
||||||
|
[[ -d .svn ]]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
* Implement the `_zsh_highlight_highlighter_acme_paint` function.
|
||||||
|
This function does the actual syntax highlighting, by calling
|
||||||
|
`_zsh_highlight_add_highlight` with the start and end of the region to
|
||||||
|
be highlighted and the `ZSH_HIGHLIGHT_STYLES` key to use. Define the default
|
||||||
|
style for that key in the highlighter script outside of any function with
|
||||||
|
`: ${ZSH_HIGHLIGHT_STYLES[key]:=value}`, being sure to prefix
|
||||||
|
the key with your highlighter name and a colon. For example:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
: ${ZSH_HIGHLIGHT_STYLES[acme:aurora]:=fg=green}
|
||||||
|
|
||||||
|
_zsh_highlight_highlighter_acme_paint() {
|
||||||
|
# Colorize the whole buffer with the 'aurora' style
|
||||||
|
_zsh_highlight_add_highlight 0 $#BUFFER acme:aurora
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need to test which options the user has set, test `zsyh_user_options`
|
||||||
|
with a sensible default if the option is not present in supported zsh
|
||||||
|
versions. For example:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
[[ ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]
|
||||||
|
```
|
||||||
|
|
||||||
|
The option name must be all lowercase with no underscores and not an alias.
|
||||||
|
|
||||||
|
* Name your own functions and global variables `_zsh_highlight_acme_*`.
|
||||||
|
|
||||||
|
- In zsh-syntax-highlighting 0.4.0 and earlier, the entrypoints
|
||||||
|
`_zsh_highlight_highlighter_acme_predicate` and
|
||||||
|
`_zsh_highlight_highlighter_acme_paint`
|
||||||
|
were named
|
||||||
|
`_zsh_highlight_acme_highlighter_predicate` and
|
||||||
|
`_zsh_highlight_highlighter_acme_paint` respectively.
|
||||||
|
|
||||||
|
These names are still supported for backwards compatibility;
|
||||||
|
however, support for them will be removed in a future major or minor release (v0.x.0 or v1.0.0).
|
||||||
|
|
||||||
|
* Activate your highlighter in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_HIGHLIGHTERS+=(acme)
|
||||||
|
```
|
||||||
|
|
||||||
|
* [Write tests](../tests/README.md).
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / brackets
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
This is the `brackets` highlighter, that highlights brackets and parentheses, and
|
||||||
|
matches them.
|
||||||
|
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
This highlighter defines the following styles:
|
||||||
|
|
||||||
|
* `bracket-error` - unmatched brackets
|
||||||
|
* `bracket-level-N` - brackets with nest level N
|
||||||
|
* `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket
|
||||||
|
|
||||||
|
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||||
|
for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
# To define styles for nested brackets up to level 4
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
|
||||||
|
```
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / cursor
|
||||||
|
-----------------------------------------------
|
||||||
|
|
||||||
|
This is the `cursor` highlighter, that highlights the cursor.
|
||||||
|
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
This highlighter defines the following styles:
|
||||||
|
|
||||||
|
* `cursor` - the style for the current cursor position
|
||||||
|
|
||||||
|
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||||
|
for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
||||||
|
```
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / line
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
This is the `line` highlighter, that highlights the whole line.
|
||||||
|
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
This highlighter defines the following styles:
|
||||||
|
|
||||||
|
* `line` - the style for the whole line
|
||||||
|
|
||||||
|
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||||
|
for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_STYLES[line]='bold'
|
||||||
|
```
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / main
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
This is the `main` highlighter, that highlights:
|
||||||
|
|
||||||
|
* Commands
|
||||||
|
* Options
|
||||||
|
* Arguments
|
||||||
|
* Paths
|
||||||
|
* Strings
|
||||||
|
|
||||||
|
This highlighter is active by default.
|
||||||
|
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
This highlighter defines the following styles:
|
||||||
|
|
||||||
|
* `unknown-token` - unknown tokens / errors
|
||||||
|
* `reserved-word` - shell reserved words (`if`, `for`)
|
||||||
|
* `alias` - aliases
|
||||||
|
* `suffix-alias` - suffix aliases (requires zsh 5.1.1 or newer)
|
||||||
|
* `global-alias` - global aliases
|
||||||
|
* `builtin` - shell builtin commands (`shift`, `pwd`, `zstyle`)
|
||||||
|
* `function` - function names
|
||||||
|
* `command` - command names
|
||||||
|
* `precommand` - precommand modifiers (e.g., `noglob`, `builtin`)
|
||||||
|
* `commandseparator` - command separation tokens (`;`, `&&`)
|
||||||
|
* `hashed-command` - hashed commands
|
||||||
|
* `autodirectory` - a directory name in command position when the `AUTO_CD` option is set
|
||||||
|
* `path` - existing filenames
|
||||||
|
* `path_pathseparator` - path separators in filenames (`/`); if unset, `path` is used (default)
|
||||||
|
* `path_prefix` - prefixes of existing filenames
|
||||||
|
* `path_prefix_pathseparator` - path separators in prefixes of existing filenames (`/`); if unset, `path_prefix` is used (default)
|
||||||
|
* `globbing` - globbing expressions (`*.txt`)
|
||||||
|
* `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`)
|
||||||
|
* `command-substitution` - command substitutions (`$(echo foo)`)
|
||||||
|
* `command-substitution-unquoted` - an unquoted command substitution (`$(echo foo)`)
|
||||||
|
* `command-substitution-quoted` - a quoted command substitution (`"$(echo foo)"`)
|
||||||
|
* `command-substitution-delimiter` - command substitution delimiters (`$(` and `)`)
|
||||||
|
* `command-substitution-delimiter-unquoted` - an unquoted command substitution delimiters (`$(` and `)`)
|
||||||
|
* `command-substitution-delimiter-quoted` - a quoted command substitution delimiters (`"$(` and `)"`)
|
||||||
|
* `process-substitution` - process substitutions (`<(echo foo)`)
|
||||||
|
* `process-substitution-delimiter` - process substitution delimiters (`<(` and `)`)
|
||||||
|
* `arithmetic-expansion` - arithmetic expansion `$(( 42 ))`)
|
||||||
|
* `single-hyphen-option` - single-hyphen options (`-o`)
|
||||||
|
* `double-hyphen-option` - double-hyphen options (`--option`)
|
||||||
|
* `back-quoted-argument` - backtick command substitution (`` `foo` ``)
|
||||||
|
* `back-quoted-argument-unclosed` - unclosed backtick command substitution (`` `foo ``)
|
||||||
|
* `back-quoted-argument-delimiter` - backtick command substitution delimiters (`` ` ``)
|
||||||
|
* `single-quoted-argument` - single-quoted arguments (`` 'foo' ``)
|
||||||
|
* `single-quoted-argument-unclosed` - unclosed single-quoted arguments (`` 'foo ``)
|
||||||
|
* `double-quoted-argument` - double-quoted arguments (`` "foo" ``)
|
||||||
|
* `double-quoted-argument-unclosed` - unclosed double-quoted arguments (`` "foo ``)
|
||||||
|
* `dollar-quoted-argument` - dollar-quoted arguments (`` $'foo' ``)
|
||||||
|
* `dollar-quoted-argument-unclosed` - unclosed dollar-quoted arguments (`` $'foo ``)
|
||||||
|
* `rc-quote` - two single quotes inside single quotes when the `RC_QUOTES` option is set (`` 'foo''bar' ``)
|
||||||
|
* `dollar-double-quoted-argument` - parameter expansion inside double quotes (`$foo` inside `""`)
|
||||||
|
* `back-double-quoted-argument` - backslash escape sequences inside double-quoted arguments (`\"` in `"foo\"bar"`)
|
||||||
|
* `back-dollar-quoted-argument` - backslash escape sequences inside dollar-quoted arguments (`\x` in `$'\x48'`)
|
||||||
|
* `assign` - parameter assignments (`x=foo` and `x=( )`)
|
||||||
|
* `redirection` - redirection operators (`<`, `>`, etc)
|
||||||
|
* `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`)
|
||||||
|
* `comment` - elided parameters in command position (`$x ls` when `$x` is unset or empty)
|
||||||
|
* `named-fd` - named file descriptor (the `fd` in `echo foo {fd}>&2`)
|
||||||
|
* `numeric-fd` - numeric file descriptor (the `2` in `echo foo {fd}>&2`)
|
||||||
|
* `arg0` - a command word other than one of those enumerated above (other than a command, precommand, alias, function, or shell builtin command).
|
||||||
|
* `default` - everything else
|
||||||
|
|
||||||
|
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||||
|
for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
# Declare the variable
|
||||||
|
typeset -A ZSH_HIGHLIGHT_STYLES
|
||||||
|
|
||||||
|
# To differentiate aliases from other command types
|
||||||
|
ZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold'
|
||||||
|
|
||||||
|
# To have paths colored instead of underlined
|
||||||
|
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
|
||||||
|
|
||||||
|
# To disable highlighting of globbing expressions
|
||||||
|
ZSH_HIGHLIGHT_STYLES[globbing]='none'
|
||||||
|
```
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
To avoid partial path lookups on a path, add the path to the `ZSH_HIGHLIGHT_DIRS_BLACKLIST` array.
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/slow_share)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Useless trivia
|
||||||
|
|
||||||
|
#### Forward compatibility.
|
||||||
|
|
||||||
|
zsh-syntax-highlighting attempts to be forward-compatible with zsh.
|
||||||
|
Specifically, we attempt to facilitate highlighting _command word_ types that
|
||||||
|
had not yet been invented when this version of zsh-syntax-highlighting was
|
||||||
|
released.
|
||||||
|
|
||||||
|
A _command word_ is something like a function name, external command name, et
|
||||||
|
cetera. (See
|
||||||
|
[Simple Commands & Pipelines in `zshmisc(1)`][zshmisc-Simple-Commands-And-Pipelines]
|
||||||
|
for a formal definition.)
|
||||||
|
|
||||||
|
If a new _kind_ of command word is ever added to zsh — something conceptually
|
||||||
|
different than "function" and "alias" and "external command" — then command words
|
||||||
|
of that (new) kind will be highlighted by the style `arg0_$kind`,
|
||||||
|
where `$kind` is the output of `type -w` on the new kind of command word. If that
|
||||||
|
style is not defined, then the style `arg0` will be used instead.
|
||||||
|
|
||||||
|
[zshmisc-Simple-Commands-And-Pipelines]: https://zsh.sourceforge.io/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / pattern
|
||||||
|
------------------------------------------------
|
||||||
|
|
||||||
|
This is the `pattern` highlighter, that highlights user-defined patterns.
|
||||||
|
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
To use this highlighter, associate patterns with styles in the
|
||||||
|
`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
# Declare the variable
|
||||||
|
typeset -A ZSH_HIGHLIGHT_PATTERNS
|
||||||
|
|
||||||
|
# To have commands starting with `rm -rf` in red:
|
||||||
|
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||||
|
```
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / regexp
|
||||||
|
------------------------------------------------
|
||||||
|
|
||||||
|
This is the `regexp` highlighter, that highlights user-defined regular
|
||||||
|
expressions. It's similar to the `pattern` highlighter, but allows more complex
|
||||||
|
patterns.
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
To use this highlighter, associate regular expressions with styles in the
|
||||||
|
`ZSH_HIGHLIGHT_REGEXP` associative array, for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
typeset -A ZSH_HIGHLIGHT_REGEXP
|
||||||
|
ZSH_HIGHLIGHT_REGEXP+=('^rm .*' fg=red,bold)
|
||||||
|
```
|
||||||
|
|
||||||
|
This will highlight lines that start with a call to the `rm` command.
|
||||||
|
|
||||||
|
The regular expressions flavour used is [PCRE][pcresyntax] when the
|
||||||
|
`RE_MATCH_PCRE` option is set and POSIX Extended Regular Expressions (ERE),
|
||||||
|
as implemented by the platform's C library, otherwise. For details on the
|
||||||
|
latter, see [the `zsh/regex` module's documentation][MAN_ZSH_REGEX] and the
|
||||||
|
`regcomp(3)` and `re_format(7)` manual pages on your system.
|
||||||
|
|
||||||
|
For instance, to highlight `sudo` only as a complete word, i.e., `sudo cmd`,
|
||||||
|
but not `sudoedit`, one might use:
|
||||||
|
|
||||||
|
* When the `RE_MATCH_PCRE` is set:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
typeset -A ZSH_HIGHLIGHT_REGEXP
|
||||||
|
ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold)
|
||||||
|
```
|
||||||
|
|
||||||
|
* When the `RE_MATCH_PCRE` is unset, on platforms with GNU `libc` (e.g., many GNU/Linux distributions):
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
typeset -A ZSH_HIGHLIGHT_REGEXP
|
||||||
|
ZSH_HIGHLIGHT_REGEXP+=('\<sudo\>' fg=123,bold)
|
||||||
|
```
|
||||||
|
|
||||||
|
* When the `RE_MATCH_PCRE` is unset, on BSD-based platforms (e.g., macOS):
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
typeset -A ZSH_HIGHLIGHT_REGEXP
|
||||||
|
ZSH_HIGHLIGHT_REGEXP+=('[[:<:]]sudo[[:>:]]' fg=123,bold)
|
||||||
|
```
|
||||||
|
|
||||||
|
Note, however, that PCRE and POSIX ERE have a large common subset:
|
||||||
|
for instance, the regular expressions `[abc]`, `a*`, and `(a|b)` have the same
|
||||||
|
meaning in both flavours.
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
See also: [regular expressions tutorial][perlretut], zsh regexp operator `=~`
|
||||||
|
in [the `zshmisc(1)` manual page][zshmisc-Conditional-Expressions]
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
[perlretut]: https://perldoc.perl.org/perlretut
|
||||||
|
[zshmisc-Conditional-Expressions]: https://zsh.sourceforge.io/Doc/Release/Conditional-Expressions.html#Conditional-Expressions
|
||||||
|
[MAN_ZSH_REGEX]: https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fregex-Module
|
||||||
|
[pcresyntax]: https://www.pcre.org/original/doc/html/pcresyntax.html
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
zsh-syntax-highlighting / highlighters / root
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
This is the `root` highlighter, that highlights the whole line if the current
|
||||||
|
user is root.
|
||||||
|
|
||||||
|
|
||||||
|
### How to tweak it
|
||||||
|
|
||||||
|
This highlighter defines the following styles:
|
||||||
|
|
||||||
|
* `root` - the style for the whole line if the current user is root.
|
||||||
|
|
||||||
|
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||||
|
for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_HIGHLIGHT_STYLES[root]='bg=red'
|
||||||
|
```
|
||||||
|
|
||||||
|
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||||
|
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||||
|
manual page][zshzle-Character-Highlighting].
|
||||||
|
|
||||||
|
[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||||
|
|
@ -1,50 +1,8 @@
|
||||||
zsh-syntax-highlighting / highlighters
|
zsh-syntax-highlighting / highlighters
|
||||||
======================================
|
======================================
|
||||||
|
|
||||||
Syntax highlighting is done by pluggable highlighters:
|
Navigate into the individual highlighters' documentation to see
|
||||||
|
what styles (`$ZSH_HIGHLIGHT_STYLES` keys) each highlighter defines.
|
||||||
|
|
||||||
* [***main***](main) - the base highlighter, and the only one active by default.
|
Refer to the [documentation on highlighters](../docs/highlighters.md) for further
|
||||||
* [***brackets***](brackets) - matches brackets and parenthesis.
|
information.
|
||||||
* [***pattern***](pattern) - matches user-defined patterns.
|
|
||||||
* [***cursor***](cursor) - matches the cursor position.
|
|
||||||
* [***root***](root) - triggered if the current user is root.
|
|
||||||
* [***line***](line) - applied to the whole command line
|
|
||||||
|
|
||||||
|
|
||||||
How to activate highlighters
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in `~/.zshrc`, for example:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
|
|
||||||
|
|
||||||
|
|
||||||
How to tweak highlighters
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Highlighters look up styles from the `ZSH_HIGHLIGHT_STYLES` array. Navigate into each highlighter directory to see what styles it defines and how to configure it.
|
|
||||||
|
|
||||||
|
|
||||||
How to implement a new highlighter
|
|
||||||
----------------------------------
|
|
||||||
|
|
||||||
To create your own ***myhighlighter*** highlighter:
|
|
||||||
|
|
||||||
* Create your script at **highlighters/*myhighlighter*/*myhighlighter*-highlighter.zsh**.
|
|
||||||
* Implement the `_zsh_highlight_myhighlighter_highlighter_predicate` function. This function must return 0 when the highlighter needs to be called, for example:
|
|
||||||
|
|
||||||
_zsh_highlight_myhighlighter_highlighter_predicate() {
|
|
||||||
# Call this highlighter in SVN repositories
|
|
||||||
[[ -d .svn ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
* Implement the `_zsh_highlight_myhighlighter_highlighter` function. This function does the actual syntax highlighting, by modifying `region_highlight`, for example:
|
|
||||||
|
|
||||||
_zsh_highlight_myhighlighter_highlighter() {
|
|
||||||
# Colorize the whole buffer with blue background
|
|
||||||
region_highlight+=(0 $#BUFFER bg=blue)
|
|
||||||
}
|
|
||||||
|
|
||||||
* Activate your highlighter in `~/.zshrc`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS+=(myhighlighter)
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
zsh-syntax-highlighting / highlighters / brackets
|
|
||||||
=================================================
|
|
||||||
|
|
||||||
This is the ***brackets*** highlighter, that highlights brackets, parenthesis and matches them.
|
|
||||||
|
|
||||||
|
|
||||||
How to activate it
|
|
||||||
------------------
|
|
||||||
To activate it, add it to `ZSH_HIGHLIGHT_HIGHLIGHTERS`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=( [...] brackets)
|
|
||||||
|
|
||||||
|
|
||||||
How to tweak it
|
|
||||||
---------------
|
|
||||||
This highlighter defines the following styles:
|
|
||||||
|
|
||||||
* `bracket-error` - unmatched brackets
|
|
||||||
* `bracket-level-N` - brackets with nest level N
|
|
||||||
* `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket
|
|
||||||
|
|
||||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
|
||||||
|
|
||||||
# To define styles for nested brackets up to level 4
|
|
||||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
|
||||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
|
|
||||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
|
|
||||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
|
|
||||||
|
|
||||||
The syntax for declaring styles is [documented here](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135).
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../../docs/highlighters/brackets.md
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors
|
# Copyright (c) 2010-2017 zsh-syntax-highlighting contributors
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
|
@ -38,73 +38,70 @@
|
||||||
: ${ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]:=standout}
|
: ${ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]:=standout}
|
||||||
|
|
||||||
# Whether the brackets highlighter should be called or not.
|
# Whether the brackets highlighter should be called or not.
|
||||||
_zsh_highlight_brackets_highlighter_predicate()
|
_zsh_highlight_highlighter_brackets_predicate()
|
||||||
{
|
{
|
||||||
_zsh_highlight_cursor_moved || _zsh_highlight_buffer_modified
|
[[ $WIDGET == zle-line-finish ]] || _zsh_highlight_cursor_moved || _zsh_highlight_buffer_modified
|
||||||
}
|
}
|
||||||
|
|
||||||
# Brackets highlighting function.
|
# Brackets highlighting function.
|
||||||
_zsh_highlight_brackets_highlighter()
|
_zsh_highlight_highlighter_brackets_paint()
|
||||||
{
|
{
|
||||||
local level=0 pos
|
local char style
|
||||||
local -A levelpos lastoflevel matching typepos
|
local -i bracket_color_size=${#ZSH_HIGHLIGHT_STYLES[(I)bracket-level-*]} buflen=${#BUFFER} level=0 matchingpos pos
|
||||||
region_highlight=()
|
local -A levelpos lastoflevel matching
|
||||||
|
|
||||||
# Find all brackets and remember which one is matching
|
# Find all brackets and remember which one is matching
|
||||||
for (( pos = 0; $pos < ${#BUFFER}; pos++ )) ; do
|
pos=0
|
||||||
local char="$BUFFER[pos+1]"
|
for char in ${(s..)BUFFER} ; do
|
||||||
|
(( ++pos ))
|
||||||
case $char in
|
case $char in
|
||||||
["([{"])
|
["([{"])
|
||||||
levelpos[$pos]=$((++level))
|
levelpos[$pos]=$((++level))
|
||||||
lastoflevel[$level]=$pos
|
lastoflevel[$level]=$pos
|
||||||
_zsh_highlight_brackets_highlighter_brackettype "$char"
|
|
||||||
;;
|
;;
|
||||||
[")]}"])
|
[")]}"])
|
||||||
matching[$lastoflevel[$level]]=$pos
|
if (( level > 0 )); then
|
||||||
matching[$pos]=$lastoflevel[$level]
|
matchingpos=$lastoflevel[$level]
|
||||||
levelpos[$pos]=$((level--))
|
levelpos[$pos]=$((level--))
|
||||||
_zsh_highlight_brackets_highlighter_brackettype "$char"
|
if _zsh_highlight_brackets_match $matchingpos $pos; then
|
||||||
;;
|
matching[$matchingpos]=$pos
|
||||||
['"'\'])
|
matching[$pos]=$matchingpos
|
||||||
# Skip everything inside quotes
|
fi
|
||||||
local quotetype=$char
|
else
|
||||||
while (( $pos < ${#BUFFER} )) ; do
|
levelpos[$pos]=-1
|
||||||
(( pos++ ))
|
fi
|
||||||
[[ $BUFFER[$pos+1] == $quotetype ]] && break
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Now highlight all found brackets
|
# Now highlight all found brackets
|
||||||
for pos in ${(k)levelpos}; do
|
for pos in ${(k)levelpos}; do
|
||||||
if [[ -n $matching[$pos] ]] && [[ $typepos[$pos] == $typepos[$matching[$pos]] ]]; then
|
if (( $+matching[$pos] )); then
|
||||||
local bracket_color_size=${#ZSH_HIGHLIGHT_STYLES[(I)bracket-level-*]}
|
if (( bracket_color_size )); then
|
||||||
local bracket_color_level=bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
|
_zsh_highlight_add_highlight $((pos - 1)) $pos bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
|
||||||
local style=$ZSH_HIGHLIGHT_STYLES[$bracket_color_level]
|
fi
|
||||||
region_highlight+=("$pos $((pos + 1)) $style")
|
|
||||||
else
|
else
|
||||||
local style=$ZSH_HIGHLIGHT_STYLES[bracket-error]
|
_zsh_highlight_add_highlight $((pos - 1)) $pos bracket-error
|
||||||
region_highlight+=("$pos $((pos + 1)) $style")
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If cursor is on a bracket, then highlight corresponding bracket, if any
|
# If cursor is on a bracket, then highlight corresponding bracket, if any.
|
||||||
pos=$CURSOR
|
if [[ $WIDGET != zle-line-finish ]]; then
|
||||||
if [[ -n $levelpos[$pos] ]] && [[ -n $matching[$pos] ]]; then
|
pos=$((CURSOR + 1))
|
||||||
local otherpos=$matching[$pos]
|
if (( $+levelpos[$pos] )) && (( $+matching[$pos] )); then
|
||||||
local style=$ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]
|
local -i otherpos=$matching[$pos]
|
||||||
region_highlight+=("$otherpos $((otherpos + 1)) $style")
|
_zsh_highlight_add_highlight $((otherpos - 1)) $otherpos cursor-matchingbracket
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Helper function to differentiate type
|
# Helper function to differentiate type
|
||||||
_zsh_highlight_brackets_highlighter_brackettype()
|
_zsh_highlight_brackets_match()
|
||||||
{
|
{
|
||||||
case $1 in
|
case $BUFFER[$1] in
|
||||||
["()"]) typepos[$pos]=round;;
|
\() [[ $BUFFER[$2] == \) ]];;
|
||||||
["[]"]) typepos[$pos]=bracket;;
|
\[) [[ $BUFFER[$2] == \] ]];;
|
||||||
["{}"]) typepos[$pos]=curly;;
|
\{) [[ $BUFFER[$2] == \} ]];;
|
||||||
*) ;;
|
*) false;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
WIDGET=zle-line-finish
|
||||||
|
|
||||||
|
BUFFER=': $foo[bar]'
|
||||||
|
CURSOR=6 # cursor is zero-based
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=
|
||||||
|
|
||||||
|
BUFFER=': ((( )))'
|
||||||
|
CURSOR=2 # cursor is zero-based
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"3 3 bracket-level-1"
|
||||||
|
"4 4 bracket-level-2"
|
||||||
|
"5 5 bracket-level-3"
|
||||||
|
"7 7 bracket-level-3"
|
||||||
|
"8 8 bracket-level-2"
|
||||||
|
"9 9 bracket-level-1"
|
||||||
|
"9 9 cursor-matchingbracket"
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=': (x)'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=
|
||||||
|
|
||||||
|
BUFFER=': ({[({[(x)]})]})'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"3 3 bracket-level-1"
|
||||||
|
"4 4 bracket-level-2"
|
||||||
|
"5 5 bracket-level-3"
|
||||||
|
"6 6 bracket-level-1"
|
||||||
|
"7 7 bracket-level-2"
|
||||||
|
"8 8 bracket-level-3"
|
||||||
|
"9 9 bracket-level-1"
|
||||||
|
"11 11 bracket-level-1"
|
||||||
|
"12 12 bracket-level-3"
|
||||||
|
"13 13 bracket-level-2"
|
||||||
|
"14 14 bracket-level-1"
|
||||||
|
"15 15 bracket-level-3"
|
||||||
|
"16 16 bracket-level-2"
|
||||||
|
"17 17 bracket-level-1"
|
||||||
|
)
|
||||||
|
|
@ -27,11 +27,16 @@
|
||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
|
||||||
BUFFER='echo ({x}]'
|
BUFFER='echo ({x}]'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # (
|
"6 6 bracket-error" # (
|
||||||
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # {
|
"7 7 bracket-level-2" # {
|
||||||
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # }
|
"9 9 bracket-level-2" # }
|
||||||
"10 10 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # )
|
"10 10 bracket-error" # )
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
|
||||||
|
BUFFER=': {"{x}"}'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"3 3 bracket-level-1"
|
||||||
|
"5 5 bracket-level-2"
|
||||||
|
"7 7 bracket-level-2"
|
||||||
|
"9 9 bracket-level-1"
|
||||||
|
)
|
||||||
|
|
@ -27,13 +27,19 @@
|
||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=
|
||||||
|
|
||||||
BUFFER='echo $(echo ${(z)array})'
|
BUFFER='echo $(echo ${(z)array})'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # (
|
"7 7 bracket-level-1" # (
|
||||||
"14 14 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # {
|
"14 14 bracket-level-2" # {
|
||||||
"15 15 $ZSH_HIGHLIGHT_STYLES[bracket-level-3]" # (
|
"15 15 bracket-level-3" # (
|
||||||
"17 17 $ZSH_HIGHLIGHT_STYLES[bracket-level-3]" # )
|
"17 17 bracket-level-3" # )
|
||||||
"23 23 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # }
|
"23 23 bracket-level-2" # }
|
||||||
"24 24 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # )
|
"24 24 bracket-level-1" # )
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2017 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=': x)'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"4 4 bracket-error" # )
|
||||||
|
)
|
||||||
|
|
@ -30,5 +30,5 @@
|
||||||
BUFFER='echo "foo ( bar"'
|
BUFFER='echo "foo ( bar"'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"1 16 $ZSH_HIGHLIGHT_STYLES[none]" # We expect the brackets highlighter to do nothing
|
"11 11 bracket-error"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,16 @@
|
||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
|
||||||
BUFFER='echo ({x})'
|
BUFFER='echo ({x})'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # (
|
"6 6 bracket-level-1" # (
|
||||||
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # {
|
"7 7 bracket-level-2" # {
|
||||||
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # }
|
"9 9 bracket-level-2" # }
|
||||||
"10 10 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # )
|
"10 10 bracket-level-1" # )
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,15 @@
|
||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||||
|
|
||||||
BUFFER='echo ({x}'
|
BUFFER='echo ({x}'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # (
|
"6 6 bracket-error" # (
|
||||||
"7 7 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # {
|
"7 7 bracket-level-2" # {
|
||||||
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-level-2]" # }
|
"9 9 bracket-level-2" # }
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,14 @@
|
||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
unsorted=1
|
||||||
|
|
||||||
|
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||||
|
|
||||||
BUFFER='echo {x})'
|
BUFFER='echo {x})'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"6 6 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # {
|
"6 6 bracket-level-1" # {
|
||||||
"8 8 $ZSH_HIGHLIGHT_STYLES[bracket-level-1]" # }
|
"8 8 bracket-level-1" # }
|
||||||
"9 9 $ZSH_HIGHLIGHT_STYLES[bracket-error]" # )
|
"9 9 bracket-error" # )
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
zsh-syntax-highlighting / highlighters / cursor
|
|
||||||
=================================================
|
|
||||||
|
|
||||||
This is the ***cursor*** highlighter, that highlights the cursor.
|
|
||||||
|
|
||||||
|
|
||||||
How to activate it
|
|
||||||
------------------
|
|
||||||
To activate it, add it to `ZSH_HIGHLIGHT_HIGHLIGHTERS`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=( [...] cursor)
|
|
||||||
|
|
||||||
|
|
||||||
How to tweak it
|
|
||||||
---------------
|
|
||||||
This highlighter defines the following styles:
|
|
||||||
|
|
||||||
* `cursor` - the style for the current cursor position
|
|
||||||
|
|
||||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
|
||||||
|
|
||||||
The syntax for declaring styles is [documented here](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135).
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../../docs/highlighters/cursor.md
|
||||||
|
|
@ -32,13 +32,16 @@
|
||||||
: ${ZSH_HIGHLIGHT_STYLES[cursor]:=standout}
|
: ${ZSH_HIGHLIGHT_STYLES[cursor]:=standout}
|
||||||
|
|
||||||
# Whether the cursor highlighter should be called or not.
|
# Whether the cursor highlighter should be called or not.
|
||||||
_zsh_highlight_cursor_highlighter_predicate()
|
_zsh_highlight_highlighter_cursor_predicate()
|
||||||
{
|
{
|
||||||
_zsh_highlight_cursor_moved
|
# remove cursor highlighting when the line is finished
|
||||||
|
[[ $WIDGET == zle-line-finish ]] || _zsh_highlight_cursor_moved
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cursor highlighting function.
|
# Cursor highlighting function.
|
||||||
_zsh_highlight_cursor_highlighter()
|
_zsh_highlight_highlighter_cursor_paint()
|
||||||
{
|
{
|
||||||
region_highlight+=("$CURSOR $(( $CURSOR + 1 )) $ZSH_HIGHLIGHT_STYLES[cursor]")
|
[[ $WIDGET == zle-line-finish ]] && return
|
||||||
|
|
||||||
|
_zsh_highlight_add_highlight $CURSOR $(( $CURSOR + 1 )) cursor
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
zsh-syntax-highlighting / highlighters / line
|
|
||||||
=================================================
|
|
||||||
|
|
||||||
This is the ***line*** highlighter, that highlights the whole line.
|
|
||||||
|
|
||||||
|
|
||||||
How to activate it
|
|
||||||
------------------
|
|
||||||
To activate it, add it to `ZSH_HIGHLIGHT_HIGHLIGHTERS`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=( [...] line)
|
|
||||||
|
|
||||||
|
|
||||||
How to tweak it
|
|
||||||
---------------
|
|
||||||
This highlighter defines the following styles:
|
|
||||||
|
|
||||||
* `line` - the style for the whole line
|
|
||||||
|
|
||||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_STYLES[line]='bold'
|
|
||||||
|
|
||||||
The syntax for declaring styles is [documented here](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135).
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../../docs/highlighters/line.md
|
||||||
|
|
@ -32,13 +32,13 @@
|
||||||
: ${ZSH_HIGHLIGHT_STYLES[line]:=}
|
: ${ZSH_HIGHLIGHT_STYLES[line]:=}
|
||||||
|
|
||||||
# Whether the root highlighter should be called or not.
|
# Whether the root highlighter should be called or not.
|
||||||
_zsh_highlight_line_highlighter_predicate()
|
_zsh_highlight_highlighter_line_predicate()
|
||||||
{
|
{
|
||||||
_zsh_highlight_buffer_modified
|
_zsh_highlight_buffer_modified
|
||||||
}
|
}
|
||||||
|
|
||||||
# root highlighting function.
|
# root highlighting function.
|
||||||
_zsh_highlight_line_highlighter()
|
_zsh_highlight_highlighter_line_paint()
|
||||||
{
|
{
|
||||||
region_highlight+=("0 $#BUFFER $ZSH_HIGHLIGHT_STYLES[line]")
|
_zsh_highlight_add_highlight 0 $#BUFFER line
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
zsh-syntax-highlighting / highlighters / main
|
|
||||||
=============================================
|
|
||||||
|
|
||||||
This is the ***main*** highlighter, that highlights:
|
|
||||||
|
|
||||||
* Commands
|
|
||||||
* Options
|
|
||||||
* Arguments
|
|
||||||
* Paths
|
|
||||||
* Strings
|
|
||||||
|
|
||||||
How to activate it
|
|
||||||
------------------
|
|
||||||
To activate it, add it to `ZSH_HIGHLIGHT_HIGHLIGHTERS`:
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=( [...] main)
|
|
||||||
|
|
||||||
This highlighter is active by default.
|
|
||||||
|
|
||||||
|
|
||||||
How to tweak it
|
|
||||||
---------------
|
|
||||||
This highlighter defines the following styles:
|
|
||||||
|
|
||||||
* `unknown-token` - unknown tokens / errors
|
|
||||||
* `reserved-word` - shell reserved words
|
|
||||||
* `alias` - aliases
|
|
||||||
* `suffix-alias` - suffix aliases (requires zsh 5.1.1 or newer)
|
|
||||||
* `builtin` - shell builtin commands
|
|
||||||
* `function` - functions
|
|
||||||
* `command` - commands
|
|
||||||
* `precommand` - precommands (i.e. exec, builtin, ...)
|
|
||||||
* `commandseparator` - command separation tokens
|
|
||||||
* `hashed-command` - hashed commands
|
|
||||||
* `path` - paths
|
|
||||||
* `path_prefix` - path prefixes
|
|
||||||
* `path_approx` - approximated paths
|
|
||||||
* `globbing` - globbing expressions (`*.txt`)
|
|
||||||
* `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`)
|
|
||||||
* `single-hyphen-option` - single hyphen options (-o)
|
|
||||||
* `double-hyphen-option` - double hyphen options (--option)
|
|
||||||
* `back-quoted-argument` - backquoted expressions (`` `foo` ``)
|
|
||||||
* `single-quoted-argument` - single quoted arguments (`` 'foo' ``)
|
|
||||||
* `double-quoted-argument` - double quoted arguments (`` "foo" ``)
|
|
||||||
* `dollar-quoted-argument` - dollar quoted arguments (`` $'foo' ``)
|
|
||||||
* `dollar-double-quoted-argument` - dollar double quoted arguments ($foo inside "")
|
|
||||||
* `back-double-quoted-argument` - back double quoted arguments (\x inside "")
|
|
||||||
* `back-dollar-quoted-argument` - back dollar quoted arguments (\x inside $'')
|
|
||||||
* `assign` - variable assignments
|
|
||||||
* `redirection` - redirection operators (`<`, `>`, etc)
|
|
||||||
* `default` - parts of the buffer that do not match anything
|
|
||||||
|
|
||||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
|
|
||||||
|
|
||||||
# Declare the variable
|
|
||||||
typeset -A ZSH_HIGHLIGHT_STYLES
|
|
||||||
|
|
||||||
# To differentiate aliases from other command types
|
|
||||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold'
|
|
||||||
|
|
||||||
# To have paths colored instead of underlined
|
|
||||||
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
|
|
||||||
|
|
||||||
# To disable highlighting of globbing expressions
|
|
||||||
ZSH_HIGHLIGHT_STYLES[globbing]='none'
|
|
||||||
|
|
||||||
The syntax for declaring styles is documented in [the `zshzle(1)` manual
|
|
||||||
page](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135).
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../../docs/highlighters/main.md
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$'/'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 path_prefix' # /
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
setopt autocd
|
||||||
|
BUFFER=$'/'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 autodirectory' # /
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$'/bi'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 3 path_prefix' # /bi
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$'/bin; /bin'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 4 unknown-token' # /bin (in middle)
|
||||||
|
'5 5 commandseparator' # ;
|
||||||
|
'7 10 path_prefix' # /bin (at end)
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
setopt autocd
|
||||||
|
BUFFER=$'/bin; /bin'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 4 autodirectory' # /bin (in middle)
|
||||||
|
'5 5 commandseparator' # ;
|
||||||
|
'7 10 autodirectory' # /bin (at end)
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$'/bin/s'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 6 path_prefix' # /bin/s
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$'/bin/sh'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 7 command' # /bin/sh
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Issue #263 (more-pathological case): aliases[x=y]=z works; the ${(z)} splitter considers
|
||||||
|
# that a single word; but it's not looked up as an alias. Hence, highlight it as an error.
|
||||||
|
aliases[x=y]='lorem ipsum dolor sit amet'
|
||||||
|
BUFFER='x=y ls'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"1 3 unknown-token" # x=y
|
||||||
|
"5 6 default" # ls
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2015 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias foo="echo hello world"
|
||||||
|
BUFFER="foo"
|
||||||
|
|
||||||
|
expected_region_highlight+=(
|
||||||
|
"1 3 alias" # foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2021 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Have to use cat here as it must be a command that exists.
|
||||||
|
# Otherwise, the test would fail with the first token being recognized
|
||||||
|
# as an "unknown-token".
|
||||||
|
alias ]=cat
|
||||||
|
|
||||||
|
BUFFER='] /'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # ]
|
||||||
|
'3 3 path' # /
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Alias must be at least 4 characters to test the regression
|
||||||
|
# cf. 139ea2b189819c43cc251825981c116959b15cc3
|
||||||
|
alias foobar='echo "$(echo foobar)"'
|
||||||
|
BUFFER='foobar'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"1 6 alias" # foobar
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# see alias-comment2.zsh and comment-followed.zsh
|
||||||
|
setopt interactivecomments
|
||||||
|
alias x=$'# foo\npwd'
|
||||||
|
BUFFER='x'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # x
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# see alias-comment1.zsh
|
||||||
|
setopt NO_interactivecomments
|
||||||
|
alias x=$'# foo\npwd'
|
||||||
|
BUFFER='x'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 unknown-token' # x (#)
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias x='echo && ls; >'
|
||||||
|
|
||||||
|
BUFFER='x file echo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # x
|
||||||
|
'3 6 default' # file
|
||||||
|
'8 11 builtin' # echo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias x=''
|
||||||
|
|
||||||
|
BUFFER='x echo foo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # x
|
||||||
|
'3 6 builtin' # echo
|
||||||
|
'8 10 default' # foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias ls='command ls'
|
||||||
|
|
||||||
|
BUFFER='ls'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"1 2 alias" # ls
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias ls=tmp tmp='command ls'
|
||||||
|
|
||||||
|
BUFFER='ls'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"1 2 alias" # ls
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias p='print -r --'
|
||||||
|
|
||||||
|
BUFFER=$'s=$(p foo)'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 10 assign' # s=$(p foo)
|
||||||
|
'3 10 default' # $(p foo)
|
||||||
|
'3 10 command-substitution-unquoted' # $(p foo)
|
||||||
|
'3 4 command-substitution-delimiter-unquoted' # $(
|
||||||
|
'5 5 alias' # p
|
||||||
|
'7 9 default' # foo
|
||||||
|
'10 10 command-substitution-delimiter-unquoted' # )
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function b() {} # beware of ALIAS_FUNC_DEF
|
||||||
|
alias a=b b=c c=b
|
||||||
|
|
||||||
|
BUFFER='a foo; :'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
# An alias is ineligible for expansion whilst it's being expanded.
|
||||||
|
# Therefore, the "b" in the expansion of the alias "c" is not considered
|
||||||
|
# as an alias.
|
||||||
|
'1 1 alias' # a
|
||||||
|
'3 5 default' # foo
|
||||||
|
'6 6 commandseparator' # ;
|
||||||
|
'8 8 builtin' # :
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2015 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias ls="ls"
|
||||||
|
BUFFER="ls"
|
||||||
|
|
||||||
|
expected_region_highlight+=(
|
||||||
|
"1 2 alias" # ls
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=b b=sudo
|
||||||
|
sudo(){}
|
||||||
|
|
||||||
|
BUFFER='a -u phy1729 echo; :'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # a
|
||||||
|
'3 4 single-hyphen-option' # -u
|
||||||
|
'6 12 default' # phy1729
|
||||||
|
'14 17 builtin' # echo
|
||||||
|
'18 18 commandseparator' # ;
|
||||||
|
'20 20 builtin' # :
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=b b=:
|
||||||
|
|
||||||
|
BUFFER='a foo; :'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # a
|
||||||
|
'3 5 default' # foo
|
||||||
|
'6 6 commandseparator' # ;
|
||||||
|
'8 8 builtin' # :
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias '$foo'='echo alias'
|
||||||
|
local foo; foo=(echo param)
|
||||||
|
|
||||||
|
BUFFER='$foo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 4 alias' # $foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# See also param-precommand-option-argument1.zsh
|
||||||
|
alias sudo_u='sudo -u'
|
||||||
|
sudo(){}
|
||||||
|
|
||||||
|
BUFFER='sudo_u phy1729 echo foo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 6 alias' # sudo_u
|
||||||
|
'8 14 default' # phy1729
|
||||||
|
'17 19 command "issue #540"' # echo (not builtin)
|
||||||
|
'21 23 default' # foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias sudo_b='sudo -b'
|
||||||
|
alias sudo_b_u='sudo_b -u'
|
||||||
|
sudo(){}
|
||||||
|
|
||||||
|
BUFFER='sudo_b_u phy1729 echo foo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 8 alias' # sudo_b_u
|
||||||
|
'10 16 default' # phy1729
|
||||||
|
'18 21 command "issue #540"' # echo (not builtin)
|
||||||
|
'23 25 default' # foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# See also param-precommand-option-argument3.zsh
|
||||||
|
alias sudo_u='sudo -u'
|
||||||
|
sudo(){}
|
||||||
|
|
||||||
|
BUFFER='sudo_u phy1729 ls foo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 6 alias' # sudo_u
|
||||||
|
'8 14 default' # phy1729
|
||||||
|
'16 17 command' # ls
|
||||||
|
'19 21 default' # foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias sudo_b='sudo -b'
|
||||||
|
alias sudo_b_u='sudo_b -u'
|
||||||
|
sudo(){}
|
||||||
|
|
||||||
|
BUFFER='sudo_b_u phy1729 ls foo'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 8 alias' # sudo_b_u
|
||||||
|
'10 16 default' # phy1729
|
||||||
|
'18 19 command' # ls
|
||||||
|
'21 23 default' # foo
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) YYYY zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=: ls='ls -l'
|
||||||
|
BUFFER='"a" foo; \ls'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 3 unknown-token' # "a"
|
||||||
|
'5 7 default' # foo
|
||||||
|
'8 8 commandseparator' # ;
|
||||||
|
'10 12 command' # \ls
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias x=\>
|
||||||
|
BUFFER='x foo echo bar'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # x
|
||||||
|
'3 5 default' # foo
|
||||||
|
'7 10 builtin' # echo
|
||||||
|
'12 14 default' # bar
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=: b='a | a'
|
||||||
|
|
||||||
|
BUFFER='b | b'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # b
|
||||||
|
'3 3 commandseparator' # |
|
||||||
|
'5 5 alias' # b
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=: b='a && a'
|
||||||
|
|
||||||
|
BUFFER='b && b'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # b
|
||||||
|
'3 4 commandseparator' # &&
|
||||||
|
'6 6 alias' # b
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=: b='a; a'
|
||||||
|
|
||||||
|
BUFFER='b; b'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # b
|
||||||
|
'2 2 commandseparator' # ;
|
||||||
|
'4 4 alias' # b
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=: b='a $(a)'
|
||||||
|
|
||||||
|
BUFFER='b $(b)'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # b
|
||||||
|
'3 6 default' # $(b)
|
||||||
|
'3 6 command-substitution-unquoted' # $(b)
|
||||||
|
'3 4 command-substitution-delimiter-unquoted' # $(
|
||||||
|
'5 5 alias' # b
|
||||||
|
'6 6 command-substitution-delimiter-unquoted' # )
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=: b='a < <(a)'
|
||||||
|
|
||||||
|
BUFFER='b < <(b)'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # b
|
||||||
|
'3 3 redirection' # <
|
||||||
|
'5 8 default' # <(b)
|
||||||
|
'5 8 process-substitution' # <(b)
|
||||||
|
'5 6 process-substitution-delimiter' # <(
|
||||||
|
'7 7 alias' # b
|
||||||
|
'8 8 process-substitution-delimiter' # )
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias echo='echo foo'
|
||||||
|
|
||||||
|
BUFFER='echo bar'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 4 alias' # echo
|
||||||
|
'6 8 default' # bar
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias cat='cat | cat'
|
||||||
|
|
||||||
|
BUFFER='cat'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 3 alias' # cat
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias x=/
|
||||||
|
BUFFER=$'x'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 unknown-token' # x (/)
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
setopt autocd
|
||||||
|
alias x=/
|
||||||
|
BUFFER=$'x'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 alias' # x
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a=b b=foo
|
||||||
|
|
||||||
|
BUFFER='a '
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 unknown-token' # a
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
alias a='() { ls "$@" ; foo }'
|
||||||
|
|
||||||
|
BUFFER='a '
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 unknown-token' # a
|
||||||
|
)
|
||||||
|
|
@ -27,12 +27,11 @@
|
||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
alias alias1="unused expansion"
|
alias alias1="ls"
|
||||||
alias -s alias2="echo"
|
alias -s alias2="echo"
|
||||||
alias1() {} # to check that it's highlighted as an alias, not as a function
|
function alias1() {} # to check that it's highlighted as an alias, not as a function
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_STYLES[alias]=$unused_highlight
|
BUFFER='x.alias2; alias1; alias2'
|
||||||
BUFFER='x.alias2; alias1'
|
|
||||||
|
|
||||||
# Set expected_region_highlight as a function of zsh version.
|
# Set expected_region_highlight as a function of zsh version.
|
||||||
#
|
#
|
||||||
|
|
@ -41,11 +40,14 @@ BUFFER='x.alias2; alias1'
|
||||||
# functionality is present, and skip verifying suffix-alias highlighting
|
# functionality is present, and skip verifying suffix-alias highlighting
|
||||||
# if it isn't.
|
# if it isn't.
|
||||||
expected_region_highlight=()
|
expected_region_highlight=()
|
||||||
if [[ "$(type -w x.alias2)" == *suffix* ]]; then
|
if zmodload -e zsh/parameter || [[ "$(type -w x.alias2)" == *suffix* ]]; then
|
||||||
expected_region_highlight+=(
|
expected_region_highlight+=(
|
||||||
"1 8 $ZSH_HIGHLIGHT_STYLES[suffix-alias]" # x.alias2
|
"1 8 suffix-alias" # x.alias2
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
expected_region_highlight+=(
|
expected_region_highlight+=(
|
||||||
"11 16 $ZSH_HIGHLIGHT_STYLES[alias]" # alias1
|
"9 9 commandseparator" # ;
|
||||||
|
"11 16 alias" # alias1
|
||||||
|
"17 17 commandseparator" # ;
|
||||||
|
"19 24 unknown-token" # alias2
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER='{ ls } always { pwd }'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 reserved-word' # {
|
||||||
|
'3 4 command' # ls
|
||||||
|
'6 6 reserved-word' # }
|
||||||
|
'8 13 reserved-word' # always
|
||||||
|
'15 15 reserved-word' # {
|
||||||
|
'17 19 builtin' # pwd
|
||||||
|
'21 21 reserved-word' # }
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$'{\nls\n} always { pwd }'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 reserved-word' # {
|
||||||
|
'2 2 commandseparator' # \n
|
||||||
|
'3 4 command' # ls
|
||||||
|
'5 5 commandseparator' # \n
|
||||||
|
'6 6 reserved-word' # }
|
||||||
|
'8 13 reserved-word' # always
|
||||||
|
'15 15 reserved-word' # {
|
||||||
|
'17 19 builtin' # pwd
|
||||||
|
'21 21 reserved-word' # }
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
setopt ignorebraces
|
||||||
|
BUFFER='echo { foo } always { bar }'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 4 builtin' # echo
|
||||||
|
'6 6 default' # {
|
||||||
|
'8 10 default' # foo
|
||||||
|
'12 12 default' # }
|
||||||
|
'14 19 default' # always
|
||||||
|
'21 21 default' # {
|
||||||
|
'23 25 default' # bar
|
||||||
|
'27 27 default' # }
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2015 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER='() echo hello; () { echo world } "argument"'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
"1 2 reserved-word" # ()
|
||||||
|
"4 7 builtin" # echo
|
||||||
|
"9 13 default" # hello
|
||||||
|
"14 14 commandseparator" # ;
|
||||||
|
"16 17 reserved-word" # ()
|
||||||
|
"19 19 reserved-word" # {
|
||||||
|
"21 24 builtin" # echo
|
||||||
|
"26 30 default" # world
|
||||||
|
"32 32 reserved-word" # }
|
||||||
|
"34 43 default" # "argument"
|
||||||
|
"34 43 double-quoted-argument" # "argument"
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=''\''x: /'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 5 unknown-token' # \'x: /
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $((ls); (ls))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 15 default' # $((ls); (ls))
|
||||||
|
'3 15 command-substitution-unquoted' # $((ls); (ls))
|
||||||
|
'3 4 command-substitution-delimiter-unquoted' # $(
|
||||||
|
'5 5 reserved-word' # (
|
||||||
|
'6 7 command' # ls
|
||||||
|
'8 8 reserved-word' # )
|
||||||
|
'9 9 commandseparator' # ;
|
||||||
|
'11 11 reserved-word' # (
|
||||||
|
'12 13 command' # ls
|
||||||
|
'14 14 reserved-word' # )
|
||||||
|
'15 15 command-substitution-delimiter-unquoted' # )
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $(( 6 * 9 ))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 14 default' # $(( 6 * 9 ))
|
||||||
|
'3 14 arithmetic-expansion' # $(( 6 * 9 ))
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': "$(( 6 * 9 ))"'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 16 default' # "$(( 6 * 9 ))"
|
||||||
|
'3 16 double-quoted-argument' # "$(( 6 * 9 ))"
|
||||||
|
'4 15 arithmetic-expansion' # $(( 6 * 9 ))
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $(( $(echo 2) + 2 ))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 22 default' # $(( $(echo 2) + 2 ))
|
||||||
|
'3 22 arithmetic-expansion' # $(( $(echo 2) + 2 ))
|
||||||
|
'7 15 command-substitution-quoted' # $(echo 2)
|
||||||
|
'7 8 command-substitution-delimiter-quoted' # $(
|
||||||
|
'9 12 builtin' # echo
|
||||||
|
'14 14 default' # 2
|
||||||
|
'15 15 command-substitution-delimiter' # )
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $(( ((42)) ))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 15 default' # $(( ((42)) ))
|
||||||
|
'3 15 arithmetic-expansion' # $(( ((42)) ))
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': "foo"$(())"bar"'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 17 default' # "foo"$(())"bar"
|
||||||
|
'3 7 double-quoted-argument' # "foo"
|
||||||
|
'8 12 arithmetic-expansion' # $(())
|
||||||
|
'13 17 double-quoted-argument' # "bar"
|
||||||
|
)
|
||||||
|
|
@ -35,5 +35,6 @@
|
||||||
BUFFER='(( x == 42 ))'
|
BUFFER='(( x == 42 ))'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ((
|
"1 2 reserved-word" # ((
|
||||||
|
"12 13 reserved-word" # ))
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $(( \!\! ))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 11 default' # $(( !! ))
|
||||||
|
'3 11 arithmetic-expansion' # $(( !! ))
|
||||||
|
'7 8 history-expansion "issue #713"' # !!
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $(( 0 * 1\'\'000 ))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 19 default' # $(( 0 * 1\'\'000 ))
|
||||||
|
'3 19 arithmetic-expansion' # $(( 0 * 1\'\'000 ))
|
||||||
|
'12 12 unknown-token' # \'
|
||||||
|
'13 13 unknown-token' # \'
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': foo*$(( 42 * 1729 ))*bar'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 26 default' # foo*$(( 42 * 1729 ))*bar
|
||||||
|
'6 6 globbing' # *
|
||||||
|
'7 22 arithmetic-expansion' # $(( 42 * 1729 ))
|
||||||
|
'23 23 globbing' # *
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# Copyright (c) 2020 zsh-syntax-highlighting contributors
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||||
|
# provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||||
|
# and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||||
|
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||||
|
# may be used to endorse or promote products derived from this software without specific prior
|
||||||
|
# written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||||
|
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
BUFFER=$': $(( $(( 1 + 2 )) * 3 ))'
|
||||||
|
|
||||||
|
expected_region_highlight=(
|
||||||
|
'1 1 builtin' # :
|
||||||
|
'3 25 default' # $(( $(( 1 + 2 )) * 3 ))
|
||||||
|
'3 25 arithmetic-expansion' # $(( $(( 1 + 2 )) * 3 ))
|
||||||
|
'7 18 arithmetic-expansion' # $(( 1 + 2 ))
|
||||||
|
)
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue