Quoting Joerg Fischer <[EMAIL PROTECTED]>:
> Once upon a time Tony Balinski wrote:
>
> > On a final note, I did manage to change the new SH background color
> > rendering so that the empty space following the line end could be colored
> > with the current SH background if applicable (for example with comments).
> > It fills out to the right as does a non-rectangular selection does. I
> > think this is slightly more "correct" than the current implementation
> > which stops "backgrounding" at the end of the line.
>
> Do you still have a patch for it or could you please give me any
> hints? I'm sort of struggling with the sources and Xlib and need help.
Wow, that was a long time ago! IIRC, you use clearRect() with an appropriate
GC in textDisp.c. Look at styleOfPos() where it returns a FILL_MASK style,
which indicates that we need to blank out to the right hand margin, and how
it's used in drawString(). You can see there how the bground variable in
drawString() picks up the the right color and to use it.
Back in styleOfPos() notice the section (textDisp.c:2184):
if (lineIndex >= lineLen)
style = FILL_MASK;
else if (styleBuf != NULL) {
...
which essentially says "if we are at a line-end we will ignore SH style". To
get line-end fills colored with the SH background, remove the word "else",
and use "style |= " instead of "style = " as follows:
if (lineIndex >= lineLen)
style = FILL_MASK;
if (styleBuf != NULL) { /* ---------------- NOTE: NO ELSE */
/* pick up styleBuf's style value separately */
int styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
if (styleChar == textD->unfinishedStyle) {
/* encountered "unfinished" style, trigger parsing */
(textD->unfinishedHighlightCB)(textD, pos, textD->highlightCBArg);
styleChar = (unsigned char)BufGetCharacter(styleBuf, pos);
}
style |= styleChar; /* add styleBuf value found to style bitmap */
}
No Xlib required!
Now the question: why?
Tony
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop