mirror of
https://github.com/zdharma-continuum/fast-syntax-highlighting.git
synced 2026-09-10 07:16:18 -04:00
Revert "*-highlight: Use [[ -v ... ]] test instead of $parameters"
This reverts commit aff7531bfa.
Plus also the same change for the math mode highlighting.
Issue #152
This commit is contained in:
parent
581e75761c
commit
c75ee58003
|
|
@ -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]}
|
||||
} || {
|
||||
|
|
|
|||
Loading…
Reference in a new issue