mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-13 10:05:31 +08:00
User's definition of highlighting from "zle_highlight" array should take precedence over custom highlighters. This is especially important for *region context* (see CHARACTER HIGHLIGHTING chapter in man zshzle
for *region context* definition), as this is overwritten by region_highlight array, leading to highlighting only parts of selected region properly.
This commit forces to use type of highlighting as defined in region context of zle_highlight array.
This commit is contained in:
parent
162655841c
commit
ece762e817
@ -90,6 +90,8 @@ _zsh_highlight()
|
|||||||
# Use value form cache if any cached
|
# Use value form cache if any cached
|
||||||
eval "region_highlight+=(\"\${${cache_place}[@]}\")"
|
eval "region_highlight+=(\"\${${cache_place}[@]}\")"
|
||||||
|
|
||||||
|
# Bring back region higlighting from zle_highlight array (was overwriten by region_highlight)
|
||||||
|
((REGION_ACTIVE)) && region_highlight+=("$((CURSOR < MARK ? CURSOR : MARK)) $((CURSOR > MARK ? CURSOR : MARK)) ${${(M)zle_highlight[@]:#region*}#region:}")
|
||||||
done
|
done
|
||||||
|
|
||||||
} always {
|
} always {
|
||||||
|
Loading…
Reference in New Issue
Block a user