# HG changeset patch # User Gerd Moellmann # Date 956691690 0 # Node ID 7606937fa8916cdc09a3870a2adaebff6897312e # Parent 4e2497e6757e4780885975f12a26188623bf3b89 (try_window_id) : Adjust positions in glyph matrix. Don't compute new window end positions. diff -r 4e2497e6757e -r 7606937fa891 src/xdisp.c --- a/src/xdisp.c Tue Apr 25 19:39:59 2000 +0000 +++ b/src/xdisp.c Tue Apr 25 19:41:30 2000 +0000 @@ -7474,10 +7474,10 @@ - MATRIX_ROW_START_BYTEPOS (row)); } - increment_glyph_matrix_buffer_positions (w->current_matrix, - this_line_vpos + 1, - w->current_matrix->nrows, - delta, delta_bytes); + increment_matrix_positions (w->current_matrix, + this_line_vpos + 1, + w->current_matrix->nrows, + delta, delta_bytes); } /* If this row displays text now but previously didn't, @@ -10056,19 +10056,38 @@ /* If window starts after a line end, and the last change is in front of that newline, then changes don't affect the display. - This case happens with stealth-fontification. */ + This case happens with stealth-fontification. Note that although + the display is unchanged, glyph positions in the matrix have to + be adjusted, of course. */ row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); if (CHARPOS (start) > BEGV && Z - END_UNCHANGED < CHARPOS (start) - 1 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n' && PT < MATRIX_ROW_END_CHARPOS (row)) { - /* We have to update window end positions because the buffer's - size has changed. */ + struct glyph_row *r0 = MATRIX_FIRST_TEXT_ROW (current_matrix); + int delta = CHARPOS (start) - MATRIX_ROW_START_CHARPOS (r0); + + if (delta) + { + struct glyph_row *r1 = MATRIX_BOTTOM_TEXT_ROW (current_matrix, w); + int delta_bytes = BYTEPOS (start) - MATRIX_ROW_START_BYTEPOS (r0); + + increment_matrix_positions (w->current_matrix, + MATRIX_ROW_VPOS (r0, current_matrix), + MATRIX_ROW_VPOS (r1, current_matrix), + delta, delta_bytes); + } + +#if 0 /* If changes are all in front of the window start, the + distance of the last displayed glyph from Z hasn't + changed. */ w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); +#endif + return 1; } @@ -10383,9 +10402,9 @@ /* Adjust buffer positions in reused rows. */ if (delta) - increment_glyph_matrix_buffer_positions (current_matrix, - first_unchanged_at_end_vpos + dvpos, - bottom_vpos, delta, delta_bytes); + increment_matrix_positions (current_matrix, + first_unchanged_at_end_vpos + dvpos, + bottom_vpos, delta, delta_bytes); /* Adjust Y positions. */ if (dy)