aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-04-25 19:41:30 +0000
committerGerd Moellmann2000-04-25 19:41:30 +0000
commitf2d86d7a049796984588b7df4c7657cac18a1cee (patch)
treeb18ec270b67f6ac21c5f5e212d28ed746c987cd3
parent86c11ba1c88dd4184e9285fddf4499ecbdffcc9a (diff)
downloademacs-f2d86d7a049796984588b7df4c7657cac18a1cee.tar.gz
emacs-f2d86d7a049796984588b7df4c7657cac18a1cee.zip
(try_window_id) <all changes above window start>: Adjust
positions in glyph matrix. Don't compute new window end positions.
-rw-r--r--src/xdisp.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index ef9add8af44..43cfd556e39 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7474,10 +7474,10 @@ redisplay_internal (preserve_echo_area)
7474 - MATRIX_ROW_START_BYTEPOS (row)); 7474 - MATRIX_ROW_START_BYTEPOS (row));
7475 } 7475 }
7476 7476
7477 increment_glyph_matrix_buffer_positions (w->current_matrix, 7477 increment_matrix_positions (w->current_matrix,
7478 this_line_vpos + 1, 7478 this_line_vpos + 1,
7479 w->current_matrix->nrows, 7479 w->current_matrix->nrows,
7480 delta, delta_bytes); 7480 delta, delta_bytes);
7481 } 7481 }
7482 7482
7483 /* If this row displays text now but previously didn't, 7483 /* If this row displays text now but previously didn't,
@@ -10056,19 +10056,38 @@ try_window_id (w)
10056 10056
10057 /* If window starts after a line end, and the last change is in 10057 /* If window starts after a line end, and the last change is in
10058 front of that newline, then changes don't affect the display. 10058 front of that newline, then changes don't affect the display.
10059 This case happens with stealth-fontification. */ 10059 This case happens with stealth-fontification. Note that although
10060 the display is unchanged, glyph positions in the matrix have to
10061 be adjusted, of course. */
10060 row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); 10062 row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
10061 if (CHARPOS (start) > BEGV 10063 if (CHARPOS (start) > BEGV
10062 && Z - END_UNCHANGED < CHARPOS (start) - 1 10064 && Z - END_UNCHANGED < CHARPOS (start) - 1
10063 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n' 10065 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n'
10064 && PT < MATRIX_ROW_END_CHARPOS (row)) 10066 && PT < MATRIX_ROW_END_CHARPOS (row))
10065 { 10067 {
10066 /* We have to update window end positions because the buffer's 10068 struct glyph_row *r0 = MATRIX_FIRST_TEXT_ROW (current_matrix);
10067 size has changed. */ 10069 int delta = CHARPOS (start) - MATRIX_ROW_START_CHARPOS (r0);
10070
10071 if (delta)
10072 {
10073 struct glyph_row *r1 = MATRIX_BOTTOM_TEXT_ROW (current_matrix, w);
10074 int delta_bytes = BYTEPOS (start) - MATRIX_ROW_START_BYTEPOS (r0);
10075
10076 increment_matrix_positions (w->current_matrix,
10077 MATRIX_ROW_VPOS (r0, current_matrix),
10078 MATRIX_ROW_VPOS (r1, current_matrix),
10079 delta, delta_bytes);
10080 }
10081
10082#if 0 /* If changes are all in front of the window start, the
10083 distance of the last displayed glyph from Z hasn't
10084 changed. */
10068 w->window_end_pos 10085 w->window_end_pos
10069 = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); 10086 = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
10070 w->window_end_bytepos 10087 w->window_end_bytepos
10071 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 10088 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
10089#endif
10090
10072 return 1; 10091 return 1;
10073 } 10092 }
10074 10093
@@ -10383,9 +10402,9 @@ try_window_id (w)
10383 10402
10384 /* Adjust buffer positions in reused rows. */ 10403 /* Adjust buffer positions in reused rows. */
10385 if (delta) 10404 if (delta)
10386 increment_glyph_matrix_buffer_positions (current_matrix, 10405 increment_matrix_positions (current_matrix,
10387 first_unchanged_at_end_vpos + dvpos, 10406 first_unchanged_at_end_vpos + dvpos,
10388 bottom_vpos, delta, delta_bytes); 10407 bottom_vpos, delta, delta_bytes);
10389 10408
10390 /* Adjust Y positions. */ 10409 /* Adjust Y positions. */
10391 if (dy) 10410 if (dy)