diff options
| author | Eli Zaretskii | 2020-07-30 16:56:36 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-07-30 16:56:36 +0300 |
| commit | 35564bea4d73bc266743216599d01d644aed6fd8 (patch) | |
| tree | 8f00c6199d19dceec8d4ad13b96c1a782f283f19 /src | |
| parent | 50ea5b871dd264e3a7fd6c3977e021f1a365cb5f (diff) | |
| download | emacs-35564bea4d73bc266743216599d01d644aed6fd8.tar.gz emacs-35564bea4d73bc266743216599d01d644aed6fd8.zip | |
Fix face extension past EOL in overlay strings
* src/xdisp.c (face_at_pos): Pass ATTR_FILTER to
face_for_overlay_string.
* src/xfaces.c (face_for_overlay_string): Accept an additional
argument ATTR_INDEX and pass it to merge_face_ref for merging the
face at POS. This ensures a face from buffer text will not be
merged unless it specifies the :extend attribute. (Bug#42552)
* src/dispextern.h (face_for_overlay_string): Adjust prototype.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 2 | ||||
| -rw-r--r-- | src/xfaces.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index e1d6eddc419..311867a0c8c 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3538,7 +3538,7 @@ void recompute_basic_faces (struct frame *); | |||
| 3538 | int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *, | 3538 | int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *, |
| 3539 | ptrdiff_t, bool, int, enum lface_attribute_index); | 3539 | ptrdiff_t, bool, int, enum lface_attribute_index); |
| 3540 | int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, | 3540 | int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, |
| 3541 | bool, Lisp_Object); | 3541 | bool, Lisp_Object, enum lface_attribute_index); |
| 3542 | int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, | 3542 | int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 3543 | ptrdiff_t *, enum face_id, bool, | 3543 | ptrdiff_t *, enum face_id, bool, |
| 3544 | enum lface_attribute_index); | 3544 | enum lface_attribute_index); |
diff --git a/src/xdisp.c b/src/xdisp.c index eb7f3e7baa1..fc17014c029 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4339,7 +4339,7 @@ face_at_pos (const struct it *it, enum lface_attribute_index attr_filter) | |||
| 4339 | (IT_CHARPOS (*it) | 4339 | (IT_CHARPOS (*it) |
| 4340 | + TEXT_PROP_DISTANCE_LIMIT), | 4340 | + TEXT_PROP_DISTANCE_LIMIT), |
| 4341 | false, | 4341 | false, |
| 4342 | from_overlay); | 4342 | from_overlay, attr_filter); |
| 4343 | } | 4343 | } |
| 4344 | else | 4344 | else |
| 4345 | { | 4345 | { |
diff --git a/src/xfaces.c b/src/xfaces.c index c4a4e1c94f3..585cfa1cf4a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6475,7 +6475,8 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 6475 | int | 6475 | int |
| 6476 | face_for_overlay_string (struct window *w, ptrdiff_t pos, | 6476 | face_for_overlay_string (struct window *w, ptrdiff_t pos, |
| 6477 | ptrdiff_t *endptr, ptrdiff_t limit, | 6477 | ptrdiff_t *endptr, ptrdiff_t limit, |
| 6478 | bool mouse, Lisp_Object overlay) | 6478 | bool mouse, Lisp_Object overlay, |
| 6479 | enum lface_attribute_index attr_filter) | ||
| 6479 | { | 6480 | { |
| 6480 | struct frame *f = XFRAME (w->frame); | 6481 | struct frame *f = XFRAME (w->frame); |
| 6481 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 6482 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| @@ -6514,7 +6515,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos, | |||
| 6514 | 6515 | ||
| 6515 | /* Merge in attributes specified via text properties. */ | 6516 | /* Merge in attributes specified via text properties. */ |
| 6516 | if (!NILP (prop)) | 6517 | if (!NILP (prop)) |
| 6517 | merge_face_ref (w, f, prop, attrs, true, NULL, 0); | 6518 | merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter); |
| 6518 | 6519 | ||
| 6519 | *endptr = endpos; | 6520 | *endptr = endpos; |
| 6520 | 6521 | ||