aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-07-17 18:17:52 +0300
committerEli Zaretskii2014-07-17 18:17:52 +0300
commit137448c0939848661fdf6e89075c1ac706d30c5e (patch)
tree1cf8adcff48506be9fc19a1cda246d415cd59440 /src
parent56968aa61ccf3933dfcd083dd03f4be559a94efd (diff)
downloademacs-137448c0939848661fdf6e89075c1ac706d30c5e.tar.gz
emacs-137448c0939848661fdf6e89075c1ac706d30c5e.zip
Fix part of bug #18035 with overlay strings on invisible text.
src/xdisp.c (init_iterator): Initialize it->stop_charpos to the buffer position where we are to start the iteration. (handle_invisible_prop): Record in it->stop_charpos the position where the invisible text ends.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xdisp.c20
2 files changed, 26 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a664b12fe6e..463c895e5da 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12014-07-17 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (init_iterator): Initialize it->stop_charpos to the
4 buffer position where we are to start the iteration.
5 (handle_invisible_prop): Record in it->stop_charpos the position
6 where the invisible text ends. (Bug#18035)
7
12014-07-16 Eli Zaretskii <eliz@gnu.org> 82014-07-16 Eli Zaretskii <eliz@gnu.org>
2 9
3 * xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent 10 * xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
diff --git a/src/xdisp.c b/src/xdisp.c
index 263f499dbfa..3ab1dd76654 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3034,6 +3034,7 @@ init_iterator (struct it *it, struct window *w,
3034 getting overlays and face properties from that position. */ 3034 getting overlays and face properties from that position. */
3035 if (charpos >= BUF_BEG (current_buffer)) 3035 if (charpos >= BUF_BEG (current_buffer))
3036 { 3036 {
3037 it->stop_charpos = charpos;
3037 it->end_charpos = ZV; 3038 it->end_charpos = ZV;
3038 eassert (charpos == BYTE_TO_CHAR (bytepos)); 3039 eassert (charpos == BYTE_TO_CHAR (bytepos));
3039 IT_CHARPOS (*it) = charpos; 3040 IT_CHARPOS (*it) = charpos;
@@ -4546,7 +4547,24 @@ handle_invisible_prop (struct it *it)
4546 && get_overlay_strings (it, it->stop_charpos)) 4547 && get_overlay_strings (it, it->stop_charpos))
4547 { 4548 {
4548 handled = HANDLED_RECOMPUTE_PROPS; 4549 handled = HANDLED_RECOMPUTE_PROPS;
4549 it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p; 4550 if (it->sp > 0)
4551 {
4552 it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
4553 /* The call to get_overlay_strings above recomputes
4554 it->stop_charpos, but it only considers changes
4555 in properties and overlays beyond iterator's
4556 current position. This causes us to miss changes
4557 that happen exactly where the invisible property
4558 ended. So we play it safe here and force the
4559 iterator to check for potential stop positions
4560 immediately after the invisible text. Note that
4561 if get_overlay_strings returns non-zero, it
4562 normally also pushed the iterator stack, so we
4563 need to update the stop position in the slot
4564 below the current one. */
4565 it->stack[it->sp - 1].stop_charpos
4566 = CHARPOS (it->stack[it->sp - 1].current.pos);
4567 }
4550 } 4568 }
4551 else if (display_ellipsis_p) 4569 else if (display_ellipsis_p)
4552 { 4570 {