aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2004-09-18 14:53:42 +0000
committerRichard M. Stallman2004-09-18 14:53:42 +0000
commit3df5f8aad8d36c6c3ceff269c67c03fcc88c2528 (patch)
treef17bd5f64dbf70ba1dd8e25a7773207272ec380b /src
parentd66fe3340cdd422dbb07a4a7f33a8830d85144e9 (diff)
downloademacs-3df5f8aad8d36c6c3ceff269c67c03fcc88c2528.tar.gz
emacs-3df5f8aad8d36c6c3ceff269c67c03fcc88c2528.zip
(try_window_reusing_current_matrix):
Handle the case where we reach the old displayed text, out of sync with the old line boundary.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c42
2 files changed, 42 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 955c8929f92..3d8cfd61200 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12004-09-18 Richard M. Stallman <rms@gnu.org>
2
3 * xdisp.c (try_window_reusing_current_matrix):
4 Handle the case where we reach the old displayed text,
5 out of sync with the old line boundary.
6
12004-09-14 Stefan <monnier@iro.umontreal.ca> 72004-09-14 Stefan <monnier@iro.umontreal.ca>
2 8
3 * fileio.c (Finsert_file_contents): Fix case of replacement in a 9 * fileio.c (Finsert_file_contents): Fix case of replacement in a
diff --git a/src/xdisp.c b/src/xdisp.c
index 496e79d194a..874f1951256 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12404,10 +12404,36 @@ try_window_reusing_current_matrix (w)
12404 last_text_row = last_reused_text_row = NULL; 12404 last_text_row = last_reused_text_row = NULL;
12405 12405
12406 while (it.current_y < it.last_visible_y 12406 while (it.current_y < it.last_visible_y
12407 && IT_CHARPOS (it) < CHARPOS (start)
12408 && !fonts_changed_p) 12407 && !fonts_changed_p)
12409 if (display_line (&it)) 12408 {
12410 last_text_row = it.glyph_row - 1; 12409 /* If we have reached into the characters in the START row,
12410 that means the line boundaries have changed. So we
12411 can't start copying with the row START. Maybe it will
12412 work to start copying with the following row. */
12413 while (IT_CHARPOS (it) > CHARPOS (start))
12414 {
12415 /* Advance to the next row as the "start". */
12416 start_row++;
12417 start = start_row->start.pos;
12418 /* If there are no more rows to try, or just one, give up. */
12419 if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
12420 || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)
12421 || CHARPOS (start) == ZV)
12422 {
12423 clear_glyph_matrix (w->desired_matrix);
12424 return 0;
12425 }
12426
12427 start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
12428 }
12429 /* If we have reached alignment,
12430 we can copy the rest of the rows. */
12431 if (IT_CHARPOS (it) == CHARPOS (start))
12432 break;
12433
12434 if (display_line (&it))
12435 last_text_row = it.glyph_row - 1;
12436 }
12411 12437
12412 /* A value of current_y < last_visible_y means that we stopped 12438 /* A value of current_y < last_visible_y means that we stopped
12413 at the previous window start, which in turn means that we 12439 at the previous window start, which in turn means that we
@@ -12415,12 +12441,12 @@ try_window_reusing_current_matrix (w)
12415 if (it.current_y < it.last_visible_y) 12441 if (it.current_y < it.last_visible_y)
12416 { 12442 {
12417 /* IT.vpos always starts from 0; it counts text lines. */ 12443 /* IT.vpos always starts from 0; it counts text lines. */
12418 nrows_scrolled = it.vpos; 12444 nrows_scrolled = it.vpos - (start_row - MATRIX_FIRST_TEXT_ROW (w->current_matrix));
12419 12445
12420 /* Find PT if not already found in the lines displayed. */ 12446 /* Find PT if not already found in the lines displayed. */
12421 if (w->cursor.vpos < 0) 12447 if (w->cursor.vpos < 0)
12422 { 12448 {
12423 int dy = it.current_y - first_row_y; 12449 int dy = it.current_y - start_row->y;
12424 12450
12425 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 12451 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
12426 row = row_containing_pos (w, PT, row, NULL, dy); 12452 row = row_containing_pos (w, PT, row, NULL, dy);
@@ -12440,7 +12466,7 @@ try_window_reusing_current_matrix (w)
12440 scroll_run_hook will clear the cursor, and use the 12466 scroll_run_hook will clear the cursor, and use the
12441 current matrix to get the height of the row the cursor is 12467 current matrix to get the height of the row the cursor is
12442 in. */ 12468 in. */
12443 run.current_y = first_row_y; 12469 run.current_y = start_row->y;
12444 run.desired_y = it.current_y; 12470 run.desired_y = it.current_y;
12445 run.height = it.last_visible_y - it.current_y; 12471 run.height = it.last_visible_y - it.current_y;
12446 12472
@@ -15335,6 +15361,10 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
15335 Lisp_Object oprops, aelt; 15361 Lisp_Object oprops, aelt;
15336 oprops = Ftext_properties_at (make_number (0), elt); 15362 oprops = Ftext_properties_at (make_number (0), elt);
15337 15363
15364 /* If the starting string's properties are not what
15365 we want, translate the string. Also, if the string
15366 is risky, do that anyway. */
15367
15338 if (NILP (Fequal (props, oprops)) || risky) 15368 if (NILP (Fequal (props, oprops)) || risky)
15339 { 15369 {
15340 /* If the starting string has properties, 15370 /* If the starting string has properties,