From 4bbd2a3bc6f8e70f2d88dfa197ae8a7d6b32f319 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 16 Mar 2020 19:07:52 +0000 Subject: [PATCH] 'main': Prepare to add additional fields to $precommand_options values. No functional change. --- highlighters/main/main-highlighter.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index a2802cc..0a899d8 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -790,8 +790,11 @@ _zsh_highlight_main_highlighter_highlight_list() elif ! (( in_redirection)) && [[ $this_word == *':start:'* ]]; then # $arg is the command word if (( ${+precommand_options[$arg]} )) && _zsh_highlight_main__is_runnable $arg; then style=precommand - flags_with_argument=${precommand_options[$arg]%:*} - flags_sans_argument=${precommand_options[$arg]#*:} + () { + set -- "${(@s.:.)precommand_options[$arg]}" + flags_with_argument=$1 + flags_sans_argument=$2 + } next_word=${next_word//:regular:/} next_word+=':sudo_opt:' next_word+=':start:'