Commit b62784b
committed
Make z.lua try treating
Previously, you needed to set `_ZL_HYPHEN=1` to treat `-` as a normal
character. Otherwise, it was treated as a Lua regexp special character, see
https://www.lua.org/pil/20.2.html. Note that it is not super-useful to treat
`-` as a special character; it is almost the same as `*` and the difference
is not very useful in the context of fuzzy matching.
Now, if `_ZL_HYPHEN` is not set, z.lua first tries to treat it as a regexp
character. If there are no results (which is likely if the user does not know
it's a special character), z.lua tries again, treating `-` as a normal
character this time.
If `_ZL_HYPHEN=0` or `_ZL_HYPHEN=1`, z.lua will always treat `-` as
either a regex symbol or as a normal character (respectively).
Hopefully, this will make the FAQ at
https://github.com/skywind3000/z.lua/wiki/FAQ#how-to-input-a-hyphen---in-the-keyword-
unnecessary. It took me weeks to look into the question of why `z
home-manager` refused to work and to find that FAQ.
I only tested this briefly, but it seems to work.- as a normal character if there are no results1 parent 7f2bfcb commit b62784b
2 files changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
1295 | | - | |
| 1295 | + | |
| 1296 | + | |
1296 | 1297 | | |
1297 | 1298 | | |
1298 | 1299 | | |
| 1300 | + | |
1299 | 1301 | | |
1300 | 1302 | | |
1301 | | - | |
| 1303 | + | |
| 1304 | + | |
1302 | 1305 | | |
1303 | 1306 | | |
1304 | 1307 | | |
| |||
1309 | 1312 | | |
1310 | 1313 | | |
1311 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1312 | 1318 | | |
1313 | 1319 | | |
1314 | 1320 | | |
| |||
1458 | 1464 | | |
1459 | 1465 | | |
1460 | 1466 | | |
1461 | | - | |
| 1467 | + | |
1462 | 1468 | | |
1463 | 1469 | | |
1464 | | - | |
| 1470 | + | |
1465 | 1471 | | |
1466 | 1472 | | |
1467 | 1473 | | |
| |||
2067 | 2073 | | |
2068 | 2074 | | |
2069 | 2075 | | |
| 2076 | + | |
2070 | 2077 | | |
2071 | 2078 | | |
2072 | 2079 | | |
2073 | 2080 | | |
| 2081 | + | |
| 2082 | + | |
2074 | 2083 | | |
2075 | 2084 | | |
2076 | 2085 | | |
| |||
0 commit comments