Compare commits

...

3 Commits

Author SHA1 Message Date
Matthew Martin a6e8ca7cf6
Merge d08d5ef7c5 into 1d85c69261 2026-02-16 10:40:42 +00:00
Matthew Martin 1d85c69261 main: precommand_options += caffeinate
Closes #975
2026-02-08 10:49:40 -06:00
Matthew Martin d08d5ef7c5 main: Remove quotes before tilde expansion 2018-09-30 17:10:23 -05:00
2 changed files with 10 additions and 4 deletions

View File

@ -372,6 +372,7 @@ _zsh_highlight_highlighter_main_paint()
'grc' :se # grc - a "generic colouriser" (that's their spelling, not mine)
'cpulimit' elp:ivz # cpulimit 0.2
'ktrace' fgpt:aBCcdiT
'caffeinate' tw:dimsu # as of macOS's caffeinate(8) dated November 9, 2012
)
# Commands that would need to skip one positional argument:
# flock
@ -1815,8 +1816,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}.
setopt localoptions nonomatch
unset REPLY
: ${REPLY:=${(Q)${~1}}}
if [[ ${1[1]} == '~' ]]; then
REPLY=${~${(Q)1}}
else
REPLY=${(Q)1}
fi
}
# -------------------------------------------------------------------------------------------------

View File

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