# HG changeset patch # User Gerd Moellmann # Date 978124176 0 # Node ID b116257b3b28bdec07dd5dc0df28a8cd520b923f # Parent dc9f6c88e69b67f6d46b884f4d01264bc24ebbd8 (check_current_matrix_flags) [GLYPH_DEBUG]: New function. (update_window) [GLYPH_DEBUG]: Call it. (scrolling_window): Prevent including current rows which are below what's displayed in the window. diff -r dc9f6c88e69b -r b116257b3b28 src/dispnew.c --- a/src/dispnew.c Fri Dec 29 21:08:50 2000 +0000 +++ b/src/dispnew.c Fri Dec 29 21:09:36 2000 +0000 @@ -3940,6 +3940,31 @@ } +#ifdef GLYPH_DEBUG + +/* Check that no row in the current matrix of window W is enabled + which is below what's displayed in the window. */ + +void +check_current_matrix_flags (w) + struct window *w; +{ + int last_seen_p = 0; + int i, yb = window_text_bottom_y (w); + + for (i = 0; i < w->current_matrix->nrows - 1; ++i) + { + struct glyph_row *row = MATRIX_ROW (w->current_matrix, i); + if (!last_seen_p && MATRIX_ROW_BOTTOM_Y (row) >= yb) + last_seen_p = 1; + else if (last_seen_p && row->enabled_p) + abort (); + } +} + +#endif /* GLYPH_DEBUG */ + + /* Update display of window W. FORCE_P non-zero means that we should not stop when detecting pending input. */ @@ -4095,6 +4120,7 @@ paused_p = 1; #if GLYPH_DEBUG + check_current_matrix_flags (w); add_window_display_history (w, w->current_matrix->method, paused_p); #endif @@ -4690,9 +4716,15 @@ we plan to reuse part of the display even if other parts are disabled. */ i = first_old + 1; - while (i < current_matrix->nrows - 1 - && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)) <= yb) - ++i; + while (i < current_matrix->nrows - 1) + { + int bottom = MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)); + if (bottom <= yb) + ++i; + if (bottom >= yb) + break; + } + last_old = i; /* Skip over rows equal at the bottom. */