main: highlight redirection targets as paths

This commit is contained in:
Ben Boeckel 2026-06-13 01:10:42 -04:00
parent 1d85c69261
commit 99680ff695
2 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@
- Highlight `&>` `>&|` `>&!` `&>|` and `&>!` as redirection.
[#942]
- Highlight redirection targets as paths if possible [#982].
# Changes in 0.8.0

View File

@ -1441,6 +1441,9 @@ _zsh_highlight_main_highlighter_highlight_argument()
if (( in_redirection )) && [[ $last_arg == *['<>']['&'] && $arg[$1,-1] == (<0->|p|-) ]]; then
if [[ $arg[$1,-1] == (p|-) ]]; then
base_style=redirection
if _zsh_highlight_main_highlighter_check_path $arg[$1,-1] 0; then
base_style=$REPLY
fi
else
base_style=numeric-fd
fi