changeset 39254:73dd40615520

(set_window_cursor_after_update): Fix code finding glyph row containing cursor when cursor_in_echo_area is >= 0.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 12 Sep 2001 11:43:47 +0000
parents 81d50e5eaf23
children 2ccde3c50b3a
files src/dispnew.c
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Tue Sep 11 18:29:37 2001 +0000
+++ b/src/dispnew.c	Wed Sep 12 11:43:47 2001 +0000
@@ -4540,22 +4540,21 @@
 	  int yb = window_text_bottom_y (w);
 
 	  last_row = NULL;
-	  for (row = MATRIX_ROW (w->current_matrix, 0);
-	       row->enabled_p;
-	       ++row)
+	  row = w->current_matrix->rows;
+	  while (row->enabled_p
+		 && (last_row == NULL
+		     || MATRIX_ROW_BOTTOM_Y (row) <= yb))
 	    {
 	      if (row->used[TEXT_AREA]
 		  && row->glyphs[TEXT_AREA][0].charpos >= 0)
 		last_row = row;
-
-	      if (MATRIX_ROW_BOTTOM_Y (row) >= yb)
-		break;
+	      ++row;
 	    }
 	  
 	  if (last_row)
 	    {
-	      struct glyph *start = row->glyphs[TEXT_AREA];
-	      struct glyph *last = start + row->used[TEXT_AREA] - 1;
+	      struct glyph *start = last_row->glyphs[TEXT_AREA];
+	      struct glyph *last = start + last_row->used[TEXT_AREA] - 1;
 
 	      while (last > start && last->charpos < 0)
 		--last;