From bb97e325e4954002dd198b4466047a660bdd91d3 Mon Sep 17 00:00:00 2001 From: Joe Rabinoff Date: Tue, 18 Feb 2020 13:46:14 -0500 Subject: [PATCH] Attempt to fix #670 Don't highlight parameters based on parameter expansion if the expansion type is 'none'. --- highlighters/main/main-highlighter.zsh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 6af3f9d..ba556cd 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -628,18 +628,24 @@ _zsh_highlight_main_highlighter_highlight_list() (( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]] then # Set $arg. + local -a words + local testarg case ${(tP)MATCH} in (*array*|*assoc*) - local -a words; words=( ${(P)MATCH} ) - arg=${words[1]} + words=( ${(P)MATCH} ) + testarg=${words[1]} ;; (*) # scalar, presumably - arg=${(P)MATCH} + words=( ${(zP)MATCH} ) + testarg=${words[1]} ;; esac - _zsh_highlight_main__type "$arg" 0 - res=$REPLY + _zsh_highlight_main__type "$testarg" 0 + if [[ -n $REPLY ]] && [[ $REPLY != none ]]; then + res=$REPLY + arg=$testarg + fi fi }