aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-12-19 21:06:53 +0200
committerEli Zaretskii2013-12-19 21:06:53 +0200
commit5df389f5306dfeab21ecb65c42a8054cb27fd8e0 (patch)
tree83a739733895ac691cd096a83a057a8443650918 /src
parent4094a7725a4b15cce5a488fc9aabf1a48e5f755d (diff)
downloademacs-5df389f5306dfeab21ecb65c42a8054cb27fd8e0.tar.gz
emacs-5df389f5306dfeab21ecb65c42a8054cb27fd8e0.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xdisp.c26
2 files changed, 20 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1a735dfc5c0..74ae25327ab 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12013-12-19 Eli Zaretskii <eliz@gnu.org> 12013-12-19 Eli Zaretskii <eliz@gnu.org>
2 2
3 * xdisp.c (extend_face_to_end_of_line): Use default face, not the
4 current text face, for extending the face of the display margins.
5 (Bug#16192)
6
3 * casefiddle.c (Fupcase_word, Fdowncase_word, Fcapitalize_word): 7 * casefiddle.c (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4 Doc fix. (Bug#16190) 8 Doc fix. (Bug#16190)
5 9
diff --git a/src/xdisp.c b/src/xdisp.c
index 0d3f473b6f1..e336ea6c333 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18876,14 +18876,16 @@ extend_face_to_end_of_line (struct it *it)
18876 && it->glyph_row->used[LEFT_MARGIN_AREA] == 0) 18876 && it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
18877 { 18877 {
18878 it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph; 18878 it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
18879 it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id; 18879 it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id =
18880 default_face->id;
18880 it->glyph_row->used[LEFT_MARGIN_AREA] = 1; 18881 it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
18881 } 18882 }
18882 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 18883 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
18883 && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0) 18884 && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
18884 { 18885 {
18885 it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph; 18886 it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
18886 it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id; 18887 it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id =
18888 default_face->id;
18887 it->glyph_row->used[RIGHT_MARGIN_AREA] = 1; 18889 it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
18888 } 18890 }
18889 } 18891 }
@@ -18952,15 +18954,8 @@ extend_face_to_end_of_line (struct it *it)
18952 it->object = make_number (0); 18954 it->object = make_number (0);
18953 it->c = it->char_to_display = ' '; 18955 it->c = it->char_to_display = ' ';
18954 it->len = 1; 18956 it->len = 1;
18955 /* The last row's blank glyphs should get the default face, to
18956 avoid painting the rest of the window with the region face,
18957 if the region ends at ZV. */
18958 if (it->glyph_row->ends_at_zv_p)
18959 it->face_id = default_face->id;
18960 else
18961 it->face_id = face->id;
18962 18957
18963 face = FACE_FROM_ID (f, it->face_id); 18958 face = FACE_FROM_ID (f, default_face->id);
18964 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 18959 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
18965 && (it->glyph_row->used[LEFT_MARGIN_AREA] 18960 && (it->glyph_row->used[LEFT_MARGIN_AREA]
18966 < WINDOW_LEFT_MARGIN_WIDTH (it->w)) 18961 < WINDOW_LEFT_MARGIN_WIDTH (it->w))
@@ -18974,6 +18969,7 @@ extend_face_to_end_of_line (struct it *it)
18974 it->current_x += g->pixel_width; 18969 it->current_x += g->pixel_width;
18975 18970
18976 it->area = LEFT_MARGIN_AREA; 18971 it->area = LEFT_MARGIN_AREA;
18972 it->face_id = default_face->id;
18977 while (it->glyph_row->used[LEFT_MARGIN_AREA] 18973 while (it->glyph_row->used[LEFT_MARGIN_AREA]
18978 < WINDOW_LEFT_MARGIN_WIDTH (it->w)) 18974 < WINDOW_LEFT_MARGIN_WIDTH (it->w))
18979 { 18975 {
@@ -18987,11 +18983,20 @@ extend_face_to_end_of_line (struct it *it)
18987 it->area = TEXT_AREA; 18983 it->area = TEXT_AREA;
18988 } 18984 }
18989 18985
18986 /* The last row's blank glyphs should get the default face, to
18987 avoid painting the rest of the window with the region face,
18988 if the region ends at ZV. */
18989 if (it->glyph_row->ends_at_zv_p)
18990 it->face_id = default_face->id;
18991 else
18992 it->face_id = face->id;
18993 face = FACE_FROM_ID (f, it->face_id);
18990 PRODUCE_GLYPHS (it); 18994 PRODUCE_GLYPHS (it);
18991 18995
18992 while (it->current_x <= it->last_visible_x) 18996 while (it->current_x <= it->last_visible_x)
18993 PRODUCE_GLYPHS (it); 18997 PRODUCE_GLYPHS (it);
18994 18998
18999 face = FACE_FROM_ID (f, default_face->id);
18995 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 19000 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
18996 && (it->glyph_row->used[RIGHT_MARGIN_AREA] 19001 && (it->glyph_row->used[RIGHT_MARGIN_AREA]
18997 < WINDOW_RIGHT_MARGIN_WIDTH (it->w)) 19002 < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
@@ -19005,6 +19010,7 @@ extend_face_to_end_of_line (struct it *it)
19005 it->current_x += g->pixel_width; 19010 it->current_x += g->pixel_width;
19006 19011
19007 it->area = RIGHT_MARGIN_AREA; 19012 it->area = RIGHT_MARGIN_AREA;
19013 it->face_id = default_face->id;
19008 while (it->glyph_row->used[RIGHT_MARGIN_AREA] 19014 while (it->glyph_row->used[RIGHT_MARGIN_AREA]
19009 < WINDOW_RIGHT_MARGIN_WIDTH (it->w)) 19015 < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
19010 { 19016 {