Commit 5df389f5 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix bug #16192 with highlight of display margins when region is active

 src/xdisp.c (extend_face_to_end_of_line): Use default face, not the
 current text face, for extending the face of the display margins.
parent 4094a772
2013-12-19 Eli Zaretskii <eliz@gnu.org> 2013-12-19 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (extend_face_to_end_of_line): Use default face, not the
current text face, for extending the face of the display margins.
(Bug#16192)
* casefiddle.c (Fupcase_word, Fdowncase_word, Fcapitalize_word): * casefiddle.c (Fupcase_word, Fdowncase_word, Fcapitalize_word):
Doc fix. (Bug#16190) Doc fix. (Bug#16190)
......
...@@ -18876,14 +18876,16 @@ extend_face_to_end_of_line (struct it *it) ...@@ -18876,14 +18876,16 @@ extend_face_to_end_of_line (struct it *it)
&& it->glyph_row->used[LEFT_MARGIN_AREA] == 0) && it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
{ {
it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph; it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id; it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id =
default_face->id;
it->glyph_row->used[LEFT_MARGIN_AREA] = 1; it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
} }
if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
&& it->glyph_row->used[RIGHT_MARGIN_AREA] == 0) && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
{ {
it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph; it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id; it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id =
default_face->id;
it->glyph_row->used[RIGHT_MARGIN_AREA] = 1; it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
} }
} }
...@@ -18952,15 +18954,8 @@ extend_face_to_end_of_line (struct it *it) ...@@ -18952,15 +18954,8 @@ extend_face_to_end_of_line (struct it *it)
it->object = make_number (0); it->object = make_number (0);
it->c = it->char_to_display = ' '; it->c = it->char_to_display = ' ';
it->len = 1; it->len = 1;
/* The last row's blank glyphs should get the default face, to
avoid painting the rest of the window with the region face,
if the region ends at ZV. */
if (it->glyph_row->ends_at_zv_p)
it->face_id = default_face->id;
else
it->face_id = face->id;
   
face = FACE_FROM_ID (f, it->face_id); face = FACE_FROM_ID (f, default_face->id);
if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
&& (it->glyph_row->used[LEFT_MARGIN_AREA] && (it->glyph_row->used[LEFT_MARGIN_AREA]
< WINDOW_LEFT_MARGIN_WIDTH (it->w)) < WINDOW_LEFT_MARGIN_WIDTH (it->w))
...@@ -18974,6 +18969,7 @@ extend_face_to_end_of_line (struct it *it) ...@@ -18974,6 +18969,7 @@ extend_face_to_end_of_line (struct it *it)
it->current_x += g->pixel_width; it->current_x += g->pixel_width;
   
it->area = LEFT_MARGIN_AREA; it->area = LEFT_MARGIN_AREA;
it->face_id = default_face->id;
while (it->glyph_row->used[LEFT_MARGIN_AREA] while (it->glyph_row->used[LEFT_MARGIN_AREA]
< WINDOW_LEFT_MARGIN_WIDTH (it->w)) < WINDOW_LEFT_MARGIN_WIDTH (it->w))
{ {
...@@ -18987,11 +18983,20 @@ extend_face_to_end_of_line (struct it *it) ...@@ -18987,11 +18983,20 @@ extend_face_to_end_of_line (struct it *it)
it->area = TEXT_AREA; it->area = TEXT_AREA;
} }
   
/* The last row's blank glyphs should get the default face, to
avoid painting the rest of the window with the region face,
if the region ends at ZV. */
if (it->glyph_row->ends_at_zv_p)
it->face_id = default_face->id;
else
it->face_id = face->id;
face = FACE_FROM_ID (f, it->face_id);
PRODUCE_GLYPHS (it); PRODUCE_GLYPHS (it);
   
while (it->current_x <= it->last_visible_x) while (it->current_x <= it->last_visible_x)
PRODUCE_GLYPHS (it); PRODUCE_GLYPHS (it);
   
face = FACE_FROM_ID (f, default_face->id);
if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
&& (it->glyph_row->used[RIGHT_MARGIN_AREA] && (it->glyph_row->used[RIGHT_MARGIN_AREA]
< WINDOW_RIGHT_MARGIN_WIDTH (it->w)) < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
...@@ -19005,6 +19010,7 @@ extend_face_to_end_of_line (struct it *it) ...@@ -19005,6 +19010,7 @@ extend_face_to_end_of_line (struct it *it)
it->current_x += g->pixel_width; it->current_x += g->pixel_width;
   
it->area = RIGHT_MARGIN_AREA; it->area = RIGHT_MARGIN_AREA;
it->face_id = default_face->id;
while (it->glyph_row->used[RIGHT_MARGIN_AREA] while (it->glyph_row->used[RIGHT_MARGIN_AREA]
< WINDOW_RIGHT_MARGIN_WIDTH (it->w)) < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment