mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
'main': Highlight backslash escape sequences outside quotes.
Fixes #631. WIP: test expectations should be updated (12 failures including cthulhu)
This commit is contained in:
parent
6fd92e1bbd
commit
c8f5d10dfe
3 changed files with 10 additions and 1 deletions
|
|
@ -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}
|
||||
|
|
@ -1328,7 +1329,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 ))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue