fixes after review

This commit is contained in:
disarmer mk 2016-10-17 09:35:14 +03:00
commit f12e1620aa
4 changed files with 85 additions and 8 deletions

View file

@ -1,5 +1,5 @@
# -------------------------------------------------------------------------------------------------
# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors
# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
@ -45,9 +45,10 @@ _zsh_highlight_highlighter_regexp_paint(){
done
}
_zsh_highlight_regexp_highlighter_loop(){
local buf="$1" pat="$2" OFFSET="$3"
local buf="$1" pat="$2"
integer OFFSET=0
local MATCH; integer MBEGIN MEND
while true;do
while true; do
[[ "$buf" =~ "$pat" ]] || return;
region_highlight+=("$((MBEGIN - 1 + OFFSET)) $((MEND + OFFSET)) $ZSH_HIGHLIGHT_REGEXP[$pat]")
buf="$buf[$(($MEND+1)),-1]"