Fix bug #11199 with killing a line at EOB that was bidi-reordered.
authorEli Zaretskii <eliz@gnu.org>
Mon, 9 Apr 2012 12:28:45 +0000 (15:28 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 9 Apr 2012 12:28:45 +0000 (15:28 +0300)
 src/xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
 "unchanged" if its end.pos is beyond ZV.

src/ChangeLog
src/xdisp.c

index ef84324..441a4c0 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-09  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <jan.h.d@swipnet.se>
 
        * nsterm.m (constrainFrameRect): Always constrain when there is only
index dcd14a1..07aad31 100644 (file)
@@ -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.  */