comparison src/dispnew.c @ 31825:62830644b967

(scrolling_window): Compare y-positions of rows equal at the start. Some simplification.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 21 Sep 2000 18:41:36 +0000
parents 59b455472b56
children 799ee0223550
comparison
equal deleted inserted replaced
31824:b3295c7e7a60 31825:62830644b967
3810 may lead to an update with only one row enabled. There may 3810 may lead to an update with only one row enabled. There may
3811 be also completely empty matrices. */ 3811 be also completely empty matrices. */
3812 while (row < end && !row->enabled_p) 3812 while (row < end && !row->enabled_p)
3813 ++row; 3813 ++row;
3814 3814
3815 /* Try reusing part of the display by inserting/deleting lines. */ 3815 /* Try reusing part of the display by copying. */
3816 if (row < end && !desired_matrix->no_scrolling_p) 3816 if (row < end && !desired_matrix->no_scrolling_p)
3817 { 3817 {
3818 int rc = scrolling_window (w, header_line_row != NULL); 3818 int rc = scrolling_window (w, header_line_row != NULL);
3819 if (rc < 0) 3819 if (rc < 0)
3820 { 3820 {
4421 int i, j, first_old, first_new, last_old, last_new; 4421 int i, j, first_old, first_new, last_old, last_new;
4422 int nruns, nbytes, n, run_idx; 4422 int nruns, nbytes, n, run_idx;
4423 struct row_entry *entry; 4423 struct row_entry *entry;
4424 4424
4425 /* Skip over rows equal at the start. */ 4425 /* Skip over rows equal at the start. */
4426 i = header_line_p ? 1 : 0; 4426 for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i)
4427 while (i < current_matrix->nrows - 1 4427 {
4428 && MATRIX_ROW_ENABLED_P (current_matrix, i) 4428 struct glyph_row *d = MATRIX_ROW (desired_matrix, i);
4429 && MATRIX_ROW_ENABLED_P (desired_matrix, i) 4429 struct glyph_row *c = MATRIX_ROW (current_matrix, i);
4430 && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (desired_matrix, i)) <= yb 4430
4431 && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)) <= yb 4431 if (c->enabled_p
4432 && row_equal_p (w, 4432 && d->enabled_p
4433 MATRIX_ROW (desired_matrix, i), 4433 && c->y == d->y
4434 MATRIX_ROW (current_matrix, i), 1)) 4434 && MATRIX_ROW_BOTTOM_Y (c) <= yb
4435 { 4435 && MATRIX_ROW_BOTTOM_Y (d) <= yb
4436 assign_row (MATRIX_ROW (current_matrix, i), 4436 && row_equal_p (w, c, d, 1))
4437 MATRIX_ROW (desired_matrix, i)); 4437 {
4438 MATRIX_ROW (desired_matrix, i)->enabled_p = 0; 4438 assign_row (c, d);
4439 ++i; 4439 d->enabled_p = 0;
4440 }
4441 else
4442 break;
4440 } 4443 }
4441 4444
4442 /* Give up if some rows in the desired matrix are not enabled. */ 4445 /* Give up if some rows in the desired matrix are not enabled. */
4443 if (!MATRIX_ROW (desired_matrix, i)->enabled_p) 4446 if (!MATRIX_ROW (desired_matrix, i)->enabled_p)
4444 return -1; 4447 return -1;