*highlight: Fix quoting detection – track backslashing of backslash

This commit is contained in:
Sebastian Gniazdowski 2016-11-01 08:36:22 +01:00
parent 32750b665e
commit 8f1d7f3f56

View file

@ -650,8 +650,10 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
while [[ "$mybuf" = (#b)[^\$\\]#((\$[a-zA-Z0-9_:]##(\[[^\]]#\])(#c0,1))|(\$[{](\([a-zA-Z0@%#]##\))(#c0,1)[a-zA-Z0-9_:#]##(\[[^\]]#\])(#c0,1)[}])|[\\][\'\"\$]|[\\](*))(*) ]]; do
[[ -n "${match[7]}" ]] && {
idx+=${mbegin[1]}
mybuf="${match[7]}"
# Skip following char it is quoted. Choice is
# made to not highlight such quoting
idx+=${mbegin[1]}+1
mybuf="${match[7]:1}"
} || {
idx+=${mbegin[1]}-1
end_idx=idx+${mend[1]}-${mbegin[1]}+1