*highlight: Simpler code related to offset calculation

This commit is contained in:
Sebastian Gniazdowski 2016-10-15 15:22:04 +02:00
parent 586fb6be17
commit 22d839f3bc

View file

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