diff --git a/fast-highlight b/fast-highlight index 7a72683..b57f41e 100644 --- a/fast-highlight +++ b/fast-highlight @@ -611,9 +611,10 @@ typeset -ga ZLAST_COMMANDS (( next_word = (next_word & ~2) | 4 | 1 )) else _mybuf=${${(Q)__arg}#\"} - if [[ $_mybuf = (#b)(*)(*)\$([a-zA-Z_][a-zA-Z0-9_]#|[0-9]##)(*) || \ + if (( ${+parameters} )) && \ + [[ $_mybuf = (#b)(*)(*)\$([a-zA-Z_][a-zA-Z0-9_]#|[0-9]##)(*) || \ $_mybuf = (#b)(*)(*)\$\{([a-zA-Z_][a-zA-Z0-9_:-]#|[0-9]##)(*) ]] && \ - [[ -v ${match[3]%%:-*} ]] + (( ${+parameters[${match[3]%%:-*}]} )) then -fast-highlight-main-type ${match[1]}${match[2]}${(P)match[3]%%:-*}${match[4]#\}} elif [[ $braces_stack = T* ]]; then # T - typedef, etc. @@ -1342,7 +1343,7 @@ zle -N -- fast-highlight-check-path-handler -fast-highlight-check-path-handler [[ ${match[1]} = [0-9]* ]] && __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathnum]} || { [[ ${match[1]} = [a-zA-Z_]* ]] && { - [[ -v ${match[1]} || ${FAST_ASSIGNS_SEEN[${match[1]}]} = 1 ]] && \ + [[ ${+parameters[${match[1]}]} = 1 || ${FAST_ASSIGNS_SEEN[${match[1]}]} = 1 ]] && \ __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}mathvar]} || \ __style=${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}matherr]} } || {