fix apply errors
[nedit-bw.git] / sh-bg-newline.diff
blob683f779ed56c1de2434810eea2cbc43d4bbaeddf
1 From: Joerg Fischer <jf505@gmx.de>
2 Subject: SH bg color also beyond newlines
4 This small patch allows the background coloring for syntax highlighting also to
5 go beyond newlines.
7 Due to a tragic misunderstanding including it was omitted some years ago for the
8 5.4 release.
10 ---
12 source/textDisp.c | 9 +++++----
13 1 file changed, 5 insertions(+), 4 deletions(-)
15 diff --quilt old/source/textDisp.c new/source/textDisp.c
16 --- old/source/textDisp.c
17 +++ new/source/textDisp.c
18 @@ -2448,13 +2448,14 @@ static int styleOfPos(textDisp *textD, i
20 if (lineIndex >= lineLen)
21 style = FILL_MASK;
22 - else if (styleBuf != NULL) {
23 - style = (unsigned char)BufGetCharacter(styleBuf, pos);
24 - if (style == textD->unfinishedStyle) {
25 + if (styleBuf != NULL) {
26 + int styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
27 + if (styleChar == textD->unfinishedStyle && textD->highlightCBArg != NULL) {
28 /* encountered "unfinished" style, trigger parsing */
29 (textD->unfinishedHighlightCB)(textD, pos, textD->highlightCBArg);
30 - style = (unsigned char)BufGetCharacter(styleBuf, pos);
31 + styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
33 + style |= styleChar;
35 if (inSelection(&buf->primary, pos, lineStartPos, dispIndex))
36 style |= PRIMARY_MASK;