This commit is contained in:
Daniel Shahaf 2024-11-22 14:15:27 +00:00 committed by GitHub
commit ca8dc4770d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -55,6 +55,7 @@
: ${ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]:=fg=yellow}
: ${ZSH_HIGHLIGHT_STYLES[rc-quote]:=fg=cyan}
: ${ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]:=fg=cyan}
: ${ZSH_HIGHLIGHT_STYLES[back-un-quoted-argument]:=fg=cyan}
: ${ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]:=fg=cyan}
: ${ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]:=fg=cyan}
: ${ZSH_HIGHLIGHT_STYLES[assign]:=none}
@ -1351,7 +1352,13 @@ _zsh_highlight_main_highlighter_highlight_argument()
i=${arg[(ib.i.)[\\\'\"\`\$\<\>\*\?]]}
case "$arg[$i]" in
"") break;;
"\\") (( i += 1 )); continue;;
"\\")
highlights+=(
$(( start_pos + i - 1 )) $((start_pos + i + 1)) back-un-quoted-argument
)
(( i += 1 ))
continue
;;
"'")
_zsh_highlight_main_highlighter_highlight_single_quote $i
(( i = REPLY ))

View file

@ -34,4 +34,5 @@ expected_region_highlight=(
'1 4 builtin' # echo
'6 18 default "issue #705"' # foo\\\nbar"baz"
'14 18 double-quoted-argument "issue #705"' # "baz"
# TODO: when fixing this, see if we can highlight the backslash-newline sequence as a comment.
)