comparison src/xdisp.c @ 28709:7606937fa891

(try_window_id) <all changes above window start>: Adjust positions in glyph matrix. Don't compute new window end positions.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 25 Apr 2000 19:41:30 +0000
parents a22cc42e941d
children 67ffd6aa22da
comparison
equal deleted inserted replaced
28708:4e2497e6757e 28709:7606937fa891
7472 delta_bytes = (Z_BYTE 7472 delta_bytes = (Z_BYTE
7473 - BYTEPOS (tlendpos) 7473 - BYTEPOS (tlendpos)
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,
7484 or vice versa, w->window_end_vpos may have to be 7484 or vice versa, w->window_end_vpos may have to be
7485 adjusted. */ 7485 adjusted. */
10054 END_UNCHANGED = Z - GPT; 10054 END_UNCHANGED = Z - GPT;
10055 } 10055 }
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
10075 /* Return quickly if changes are all below what is displayed in the 10094 /* Return quickly if changes are all below what is displayed in the
10076 window, and if PT is in the window. */ 10095 window, and if PT is in the window. */
10381 if (!FRAME_WINDOW_P (f)) 10400 if (!FRAME_WINDOW_P (f))
10382 sync_frame_with_window_matrix_rows (w); 10401 sync_frame_with_window_matrix_rows (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)
10392 shift_glyph_matrix (w, current_matrix, 10411 shift_glyph_matrix (w, current_matrix,
10393 first_unchanged_at_end_vpos + dvpos, 10412 first_unchanged_at_end_vpos + dvpos,