mirror of
https://github.com/zsh-users/zsh-syntax-highlighting
synced 2025-01-05 18:29:29 +00:00
main: Highlight options as base_style
This means --foo="bar" will have quotes highlighted.
This commit is contained in:
parent
a65a07fae4
commit
6d133a0eb0
@ -680,8 +680,6 @@ _zsh_highlight_highlighter_main_paint()
|
|||||||
# Fall through to the catchall case at the end.
|
# Fall through to the catchall case at the end.
|
||||||
fi
|
fi
|
||||||
;|
|
;|
|
||||||
'--'*) style=double-hyphen-option;;
|
|
||||||
'-'*) style=single-hyphen-option;;
|
|
||||||
*) if false; then
|
*) if false; then
|
||||||
elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then
|
elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then
|
||||||
# was handled by the $'\x7d' case above
|
# was handled by the $'\x7d' case above
|
||||||
@ -805,6 +803,15 @@ _zsh_highlight_main_highlighter_highlight_argument()
|
|||||||
local -a match mbegin mend
|
local -a match mbegin mend
|
||||||
local MATCH; integer MBEGIN MEND
|
local MATCH; integer MBEGIN MEND
|
||||||
|
|
||||||
|
if [[ $arg[1] == - ]]; then
|
||||||
|
if [[ $arg[2] == - ]]; then
|
||||||
|
base_style=double-hyphen-option
|
||||||
|
else
|
||||||
|
base_style=single-hyphen-option
|
||||||
|
fi
|
||||||
|
path_eligible=0
|
||||||
|
fi
|
||||||
|
|
||||||
for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do
|
for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do
|
||||||
case "$arg[$i]" in
|
case "$arg[$i]" in
|
||||||
"\\") (( i += 1 )); continue;;
|
"\\") (( i += 1 )); continue;;
|
||||||
|
Loading…
Reference in New Issue
Block a user