comparison src/dispnew.c @ 34929:b116257b3b28

(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.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 29 Dec 2000 21:09:36 +0000
parents 53e52b3525bf
children 4fc804373f2a
comparison
equal deleted inserted replaced
34928:dc9f6c88e69b 34929:b116257b3b28
3938 break; 3938 break;
3939 } 3939 }
3940 } 3940 }
3941 3941
3942 3942
3943 #ifdef GLYPH_DEBUG
3944
3945 /* Check that no row in the current matrix of window W is enabled
3946 which is below what's displayed in the window. */
3947
3948 void
3949 check_current_matrix_flags (w)
3950 struct window *w;
3951 {
3952 int last_seen_p = 0;
3953 int i, yb = window_text_bottom_y (w);
3954
3955 for (i = 0; i < w->current_matrix->nrows - 1; ++i)
3956 {
3957 struct glyph_row *row = MATRIX_ROW (w->current_matrix, i);
3958 if (!last_seen_p && MATRIX_ROW_BOTTOM_Y (row) >= yb)
3959 last_seen_p = 1;
3960 else if (last_seen_p && row->enabled_p)
3961 abort ();
3962 }
3963 }
3964
3965 #endif /* GLYPH_DEBUG */
3966
3967
3943 /* Update display of window W. FORCE_P non-zero means that we should 3968 /* Update display of window W. FORCE_P non-zero means that we should
3944 not stop when detecting pending input. */ 3969 not stop when detecting pending input. */
3945 3970
3946 static int 3971 static int
3947 update_window (w, force_p) 3972 update_window (w, force_p)
4093 } 4118 }
4094 else 4119 else
4095 paused_p = 1; 4120 paused_p = 1;
4096 4121
4097 #if GLYPH_DEBUG 4122 #if GLYPH_DEBUG
4123 check_current_matrix_flags (w);
4098 add_window_display_history (w, w->current_matrix->method, paused_p); 4124 add_window_display_history (w, w->current_matrix->method, paused_p);
4099 #endif 4125 #endif
4100 4126
4101 clear_glyph_matrix (desired_matrix); 4127 clear_glyph_matrix (desired_matrix);
4102 4128
4688 /* Set last_old to the index + 1 of the last enabled row in the 4714 /* Set last_old to the index + 1 of the last enabled row in the
4689 current matrix. We don't look at the enabled flag here because 4715 current matrix. We don't look at the enabled flag here because
4690 we plan to reuse part of the display even if other parts are 4716 we plan to reuse part of the display even if other parts are
4691 disabled. */ 4717 disabled. */
4692 i = first_old + 1; 4718 i = first_old + 1;
4693 while (i < current_matrix->nrows - 1 4719 while (i < current_matrix->nrows - 1)
4694 && MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i)) <= yb) 4720 {
4695 ++i; 4721 int bottom = MATRIX_ROW_BOTTOM_Y (MATRIX_ROW (current_matrix, i));
4722 if (bottom <= yb)
4723 ++i;
4724 if (bottom >= yb)
4725 break;
4726 }
4727
4696 last_old = i; 4728 last_old = i;
4697 4729
4698 /* Skip over rows equal at the bottom. */ 4730 /* Skip over rows equal at the bottom. */
4699 i = last_new; 4731 i = last_new;
4700 j = last_old; 4732 j = last_old;