diff options
| author | Eli Zaretskii | 2015-05-19 18:39:25 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-05-19 18:39:25 +0300 |
| commit | 18338b1dff981b17426048dfa20a4c6e6e12c5aa (patch) | |
| tree | 8aeeec235fe38b3e9d66933def2265285c1c88a6 /src | |
| parent | 08033db08bc2bc75221b0dde97257c987d4efa00 (diff) | |
| download | emacs-18338b1dff981b17426048dfa20a4c6e6e12c5aa.tar.gz emacs-18338b1dff981b17426048dfa20a4c6e6e12c5aa.zip | |
Fix display of overlapping window-specific overlays
* src/keyboard.c (adjust_point_for_property): When adjusting point
due to display strings, ignore overlays that are specific to
windows other than the currently selected one.
* src/xdisp.c (handle_single_display_spec): If the display
property comes from an overlay, arrange for buffer iteration to
resume only after the end of that overlay. (Bug#20607)
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 77f7fb97898..eb66c445559 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1702,7 +1702,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified) | |||
| 1702 | if (check_display | 1702 | if (check_display |
| 1703 | && PT > BEGV && PT < ZV | 1703 | && PT > BEGV && PT < ZV |
| 1704 | && !NILP (val = get_char_property_and_overlay | 1704 | && !NILP (val = get_char_property_and_overlay |
| 1705 | (make_number (PT), Qdisplay, Qnil, &overlay)) | 1705 | (make_number (PT), Qdisplay, selected_window, |
| 1706 | &overlay)) | ||
| 1706 | && display_prop_intangible_p (val, overlay, PT, PT_BYTE) | 1707 | && display_prop_intangible_p (val, overlay, PT, PT_BYTE) |
| 1707 | && (!OVERLAYP (overlay) | 1708 | && (!OVERLAYP (overlay) |
| 1708 | ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) | 1709 | ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) |
diff --git a/src/xdisp.c b/src/xdisp.c index c2f0b747c6e..8123719ed48 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4899,6 +4899,20 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4899 | { | 4899 | { |
| 4900 | start_pos = *position; | 4900 | start_pos = *position; |
| 4901 | *position = display_prop_end (it, object, start_pos); | 4901 | *position = display_prop_end (it, object, start_pos); |
| 4902 | /* If the display property comes from an overlay, don't consider | ||
| 4903 | any potential stop_charpos values before the end of that | ||
| 4904 | overlay. Since display_prop_end will happily find another | ||
| 4905 | 'display' property coming from some other overlay or text | ||
| 4906 | property on buffer positions before this overlay's end, we | ||
| 4907 | need to ignore them, or else we risk displaying this | ||
| 4908 | overlay's display string/image twice. */ | ||
| 4909 | if (!NILP (overlay)) | ||
| 4910 | { | ||
| 4911 | ptrdiff_t ovendpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | ||
| 4912 | |||
| 4913 | if (ovendpos > CHARPOS (*position)) | ||
| 4914 | SET_TEXT_POS (*position, ovendpos, CHAR_TO_BYTE (ovendpos)); | ||
| 4915 | } | ||
| 4902 | } | 4916 | } |
| 4903 | value = Qnil; | 4917 | value = Qnil; |
| 4904 | 4918 | ||