3 source/textDisp.c | 9 +++++----
4 1 files changed, 5 insertions(+), 4 deletions(-)
6 diff --quilt old/source/textDisp.c new/source/textDisp.c
7 --- old/source/textDisp.c
8 +++ new/source/textDisp.c
9 @@ -2453,17 +2453,18 @@ static int styleOfPos(textDisp *textD, i
11 pos = lineStartPos + min(lineIndex, lineLen);
13 if (lineIndex >= lineLen)
15 - else if (styleBuf != NULL) {
16 - style = (unsigned char)BufGetCharacter(styleBuf, pos);
17 - if (style == textD->unfinishedStyle) {
18 + if (styleBuf != NULL) {
19 + int styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
20 + if (styleChar == textD->unfinishedStyle && textD->highlightCBArg != NULL) {
21 /* encountered "unfinished" style, trigger parsing */
22 (textD->unfinishedHighlightCB)(textD, pos, textD->highlightCBArg);
23 - style = (unsigned char)BufGetCharacter(styleBuf, pos);
24 + styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
28 if (inSelection(&buf->primary, pos, lineStartPos, dispIndex))
29 style |= PRIMARY_MASK;
30 if (inSelection(&buf->highlight, pos, lineStartPos, dispIndex))
31 style |= HIGHLIGHT_MASK;