From 6d133a0eb0c2abaa4a97c584c100f460a405b273 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Sun, 14 Jan 2018 21:24:44 -0600 Subject: [PATCH] main: Highlight options as base_style This means --foo="bar" will have quotes highlighted. --- highlighters/main/main-highlighter.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 43a97da..b132c2a 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -680,8 +680,6 @@ _zsh_highlight_highlighter_main_paint() # Fall through to the catchall case at the end. fi ;| - '--'*) style=double-hyphen-option;; - '-'*) style=single-hyphen-option;; *) if false; then elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then # was handled by the $'\x7d' case above @@ -805,6 +803,15 @@ _zsh_highlight_main_highlighter_highlight_argument() local -a match 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 case "$arg[$i]" in "\\") (( i += 1 )); continue;;