*highlight: Use mend, don't manually check length of match (for $offset)

This commit is contained in:
Sebastian Gniazdowski 2016-10-17 07:36:14 +02:00
parent fb4c4b7b81
commit cf97c91dba

View file

@ -309,7 +309,7 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
integer offset=0
if [[ "$proc_buf" = (#b)(#s)(([[:space:]]|\\[[:space:]])##)* ]]; then
# The first, outer parenthesis
offset="${#match[1]}"
offset="${mend[1]}"
fi
((start_pos+=offset))
((end_pos=$start_pos+${#arg}))