Index: doc/text.n ================================================================== --- doc/text.n +++ doc/text.n @@ -489,13 +489,14 @@ \fB\-lmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not contain characters because they are indented by \fB\-lmargin1\fR or \fB\-lmargin2\fR. It may have any of the forms accepted by -\fBTk_GetColor\fR.If \fIcolor\fR has not been specified, or if it is -specified as an empty string, then the color specified by the -\fB-background\fR widget option is used. +\fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is +specified as an empty string, then the color used is specified by the +\fB-background\fR tag option (or, if this is also unspecified, by the +\fB-background\fR widget option). .TP \fB\-offset \fIpixels\fR . \fIPixels\fR specifies an amount by which the text's baseline should be offset vertically from the baseline of the overall line, in pixels. For example, a @@ -535,13 +536,14 @@ .TP \fB\-rmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not contain characters because they are indented by \fB\-rmargin1\fR. It may -have any of the forms accepted by \fBTk_GetColor\fR.If \fIcolor\fR has not +have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color -specified by the \fB-background\fR widget option is used. +used is specified by the \fB-background\fR tag option (or, if this is also +unspecified, by the \fB-background\fR widget option). .TP \fB\-selectbackground \fIcolor\fR \fIColor\fR specifies the background color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty Index: generic/tkTextDisp.c ================================================================== --- generic/tkTextDisp.c +++ generic/tkTextDisp.c @@ -2462,11 +2462,17 @@ Tk_Fill3DRectangle(textPtr->tkwin, pixmap, textPtr->border, 0, y, Tk_Width(textPtr->tkwin), dlPtr->height, 0, TK_RELIEF_FLAT); /* - * Second, draw the background color of the left and right margins. + * Second, draw background information for the whole line. + */ + + DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap); + + /* + * Third, draw the background color of the left and right margins. */ if (dlPtr->lMarginColor != NULL) { Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y, dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset, dlPtr->height, 0, TK_RELIEF_FLAT); @@ -2475,16 +2481,10 @@ Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->rMarginColor, dInfoPtr->maxX - dlPtr->rMarginWidth + dInfoPtr->curXPixelOffset, y, dlPtr->rMarginWidth, dlPtr->height, 0, TK_RELIEF_FLAT); } - /* - * Next, draw background information for the whole line. - */ - - DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap); - /* * Make another pass through all of the chunks to redraw the insertion * cursor, if it is visible on this line. Must do it here rather than in * the foreground pass below because otherwise a wide insertion cursor * will obscure the character to its left.