aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 93ca88b4bdb..a00b5293619 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -505,6 +505,8 @@ prepare_menu_bars ()
505 See Fcall_process; if you called it from here, it could be 505 See Fcall_process; if you called it from here, it could be
506 entered recursively. */ 506 entered recursively. */
507 507
508static int do_verify_charstarts;
509
508void 510void
509redisplay () 511redisplay ()
510{ 512{
@@ -623,7 +625,10 @@ redisplay ()
623 if (cursor_vpos >= 0 && this_line_bufpos 625 if (cursor_vpos >= 0 && this_line_bufpos
624 && this_line_endpos == tlendpos) 626 && this_line_endpos == tlendpos)
625 { 627 {
626 if (this_line_vpos < XFASTINT (w->top) + window_internal_height (w)) 628 /* If this is not the window's last line,
629 we must adjust the charstarts of the lines below. */
630 if (this_line_vpos + 1
631 < XFASTINT (w->top) + window_internal_height (w))
627 { 632 {
628 int left = XFASTINT (w->left); 633 int left = XFASTINT (w->left);
629 int *charstart_next_line 634 int *charstart_next_line
@@ -832,7 +837,8 @@ update:
832 w->window_end_valid = Qt; 837 w->window_end_valid = Qt;
833 last_arrow_position = Voverlay_arrow_position; 838 last_arrow_position = Voverlay_arrow_position;
834 last_arrow_string = Voverlay_arrow_string; 839 last_arrow_string = Voverlay_arrow_string;
835 verify_charstarts (w); 840 if (do_verify_charstarts)
841 verify_charstarts (w);
836 if (frame_up_to_date_hook != 0) 842 if (frame_up_to_date_hook != 0)
837 (*frame_up_to_date_hook) (selected_frame); 843 (*frame_up_to_date_hook) (selected_frame);
838 } 844 }
@@ -1601,7 +1607,14 @@ try_window_id (window)
1601 blank_end_of_window = 1; 1607 blank_end_of_window = 1;
1602 } 1608 }
1603 else if (!scroll_amount) 1609 else if (!scroll_amount)
1604 {} 1610 {
1611 /* Even if we don't need to scroll, we must adjust the
1612 charstarts of subsequent lines (that we won't redisplay)
1613 according to the amount of text inserted or deleted. */
1614 int oldpos = FRAME_CURRENT_GLYPHS (f)->charstarts[ep.vpos + top][0];
1615 int adjust = ep.bufpos - oldpos;
1616 adjust_window_charstarts (w, ep.vpos + top - 1, adjust);
1617 }
1605 else if (bp.bufpos == Z - end_unchanged) 1618 else if (bp.bufpos == Z - end_unchanged)
1606 { 1619 {
1607 /* If reprinting everything is nearly as fast as scrolling, 1620 /* If reprinting everything is nearly as fast as scrolling,