From e53357c466196161fa36dc35cc215b050b7f88a8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 9 Apr 2012 15:28:45 +0300 Subject: [PATCH] Fix bug #11199 with killing a line at EOB that was bidi-reordered. src/xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row "unchanged" if its end.pos is beyond ZV. --- src/ChangeLog | 5 +++++ src/xdisp.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index ef84324c9d9..441a4c00be8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-04-09 Eli Zaretskii + + * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row + "unchanged" if its end.pos is beyond ZV. (Bug#11199) + 2012-04-09 Jan Djärv * nsterm.m (constrainFrameRect): Always constrain when there is only diff --git a/src/xdisp.c b/src/xdisp.c index dcd14a1792a..07aad31abf1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16602,7 +16602,15 @@ find_last_unchanged_at_beg_row (struct window *w) continued. */ && !(MATRIX_ROW_END_CHARPOS (row) == first_changed_pos && (row->continued_p - || row->exact_window_width_line_p))) + || row->exact_window_width_line_p)) + /* If ROW->end is beyond ZV, then ROW->end is outdated and + needs to be recomputed, so don't consider this row as + unchanged. This happens when the last line was + bidi-reordered and was killed immediately before this + redisplay cycle. In that case, ROW->end stores the + buffer position of the first visual-order character of + the next row, which is now beyond ZV. */ + && CHARPOS (row->end.pos) <= ZV) row_found = row; /* Stop if last visible row. */ -- 2.11.4.GIT