ajbj patch round-up
[nedit-bw.git] / sh-bg-newline.diff
blob79910adcc43700d689215f6b7f0ea468364b3d83
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 @@ -2446,17 +2446,18 @@ static int styleOfPos(textDisp *textD, i
20 pos = lineStartPos + min(lineIndex, lineLen);
22 if (lineIndex >= lineLen)
23 style = FILL_MASK;
24 - else if (styleBuf != NULL) {
25 - style = (unsigned char)BufGetCharacter(styleBuf, pos);
26 - if (style == textD->unfinishedStyle) {
27 + if (styleBuf != NULL) {
28 + int styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
29 + if (styleChar == textD->unfinishedStyle && textD->highlightCBArg != NULL) {
30 /* encountered "unfinished" style, trigger parsing */
31 (textD->unfinishedHighlightCB)(textD, pos, textD->highlightCBArg);
32 - style = (unsigned char)BufGetCharacter(styleBuf, pos);
33 + styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
35 + style |= styleChar;
37 if (inSelection(&buf->primary, pos, lineStartPos, dispIndex))
38 style |= PRIMARY_MASK;
39 if (inSelection(&buf->highlight, pos, lineStartPos, dispIndex))
40 style |= HIGHLIGHT_MASK;