'main': Support multiple styles in _zsh_highlight_main_add_region_highlight

This commit is contained in:
m0viefreak 2016-05-12 21:04:35 +02:00
parent d37c55c788
commit 61f43255ab

View File

@ -68,7 +68,7 @@ _zsh_highlight_main_highlighter_predicate()
# Helper to deal with tokens crossing line boundaries. # Helper to deal with tokens crossing line boundaries.
_zsh_highlight_main_add_region_highlight() { _zsh_highlight_main_add_region_highlight() {
integer start=$1 end=$2 integer start=$1 end=$2
local style=$3 shift 2
# The calculation was relative to $PREBUFFER$BUFFER, but region_highlight is # The calculation was relative to $PREBUFFER$BUFFER, but region_highlight is
# relative to $BUFFER. # relative to $BUFFER.
@ -77,7 +77,7 @@ _zsh_highlight_main_add_region_highlight() {
(( end < 0 )) && return # having end<0 would be a bug (( end < 0 )) && return # having end<0 would be a bug
(( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings (( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings
_zsh_highlight_add_highlight $start $end $style _zsh_highlight_add_highlight $start $end "$@"
} }
# Wrapper around 'type -w'. # Wrapper around 'type -w'.