Compare commits

...

3 Commits

Author SHA1 Message Date
Matthew Martin 1cf0fe6fc4
Merge d08d5ef7c5 into 2fc57d6306 2026-08-22 09:20:14 +07:00
Manish Tiwari 2fc57d6306 tests: fix relative links in tests/README.md
test-highlighting.zsh and test-perfs.zsh were linked as tests/test-*.zsh,
but this file already lives in tests/, so the links resolved to
tests/tests/test-*.zsh and 404'd. Found by pointing a markdown
link-checker at the repo.
2026-08-21 21:19:05 -05:00
Matthew Martin d08d5ef7c5 main: Remove quotes before tilde expansion 2018-09-30 17:10:23 -05:00
3 changed files with 11 additions and 6 deletions

View File

@ -1817,8 +1817,11 @@ _zsh_highlight_main_highlighter_expand_path()
# The $~1 syntax normally performs filename generation, but not when it's on the right-hand side of ${x:=y}. # The $~1 syntax normally performs filename generation, but not when it's on the right-hand side of ${x:=y}.
setopt localoptions nonomatch setopt localoptions nonomatch
unset REPLY if [[ ${1[1]} == '~' ]]; then
: ${REPLY:=${(Q)${~1}}} REPLY=${~${(Q)1}}
else
REPLY=${(Q)1}
fi
} }
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------

View File

@ -31,9 +31,11 @@ mkdir mydir
touch mydir/path-tilde-named.test touch mydir/path-tilde-named.test
hash -d D=mydir hash -d D=mydir
BUFFER='ls ~D/path-tilde-named.test' BUFFER='ls ~D/path-tilde-named.test ~"D"'
expected_region_highlight=( expected_region_highlight=(
"1 2 command" # ls "1 2 command" # ls
"4 27 path" # ~D/path-tilde-named.test "4 27 path" # ~D/path-tilde-named.test
"29 32 path" # ~"D"
"30 32 double-quoted-argument" # "D"
) )

View File

@ -86,7 +86,7 @@ grow ways to set `$PREBUFFER` to inject free-form code into the generated file.
Highlighting test Highlighting test
----------------- -----------------
[`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of [`test-highlighting.zsh`](test-highlighting.zsh) tests the correctness of
the highlighting. Usage: the highlighting. Usage:
```zsh ```zsh
@ -110,7 +110,7 @@ results (tests that failed but were expected to succeed, or vice-versa), run
Performance test Performance test
---------------- ----------------
[`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the [`test-perfs.zsh`](test-perfs.zsh) measures the time spent doing the
highlighting. Usage: highlighting. Usage:
```zsh ```zsh