Use the new, unreleased zsh 'memo=' feature to remove only our own entries from $region_highlight.
Fixes #418 (interoperability issue with other plugins).
This commit is contained in:
@@ -54,7 +54,7 @@ _zsh_highlight_pattern_highlighter_loop()
|
||||
local -a match mbegin mend
|
||||
local MATCH; integer MBEGIN MEND
|
||||
if [[ "$buf" == (#b)(*)(${~pat})* ]]; then
|
||||
region_highlight+=("$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_PATTERNS[$pat]")
|
||||
region_highlight+=("$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_PATTERNS[$pat], memo=zsh-syntax-highlighting")
|
||||
"$0" "$match[1]" "$pat"; return $?
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ _zsh_highlight_regexp_highlighter_loop()
|
||||
local -a match mbegin mend
|
||||
while true; do
|
||||
[[ "$buf" =~ "$pat" ]] || return;
|
||||
region_highlight+=("$((MBEGIN - 1 + OFFSET)) $((MEND + OFFSET)) $ZSH_HIGHLIGHT_REGEXP[$pat]")
|
||||
region_highlight+=("$((MBEGIN - 1 + OFFSET)) $((MEND + OFFSET)) $ZSH_HIGHLIGHT_REGEXP[$pat], memo=zsh-syntax-highlighting")
|
||||
buf="$buf[$(($MEND+1)),-1]"
|
||||
OFFSET=$((MEND+OFFSET));
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user