]> code.delx.au - gnu-emacs/commitdiff
(get_window_cursor_type, display_and_set_cursor): Fix last change.
authorKim F. Storm <storm@cua.dk>
Wed, 18 Feb 2004 21:01:50 +0000 (21:01 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 18 Feb 2004 21:01:50 +0000 (21:01 +0000)
src/xdisp.c

index 0967041f3b65fe7e0be928899e8fe3d007ac5846..f068290078f37a3ee3fa699db48c850baaaec139 100644 (file)
@@ -19029,9 +19029,9 @@ get_window_cursor_type (w, glyph, width, active_cursor)
     cursor_type = get_specified_cursor_type (b->cursor_type, width);
 
   /* Use normal cursor if not blinked off.  */
-  if (!w->cursor_off_p && glyph != NULL)
+  if (!w->cursor_off_p)
     {
-      if (glyph->type == IMAGE_GLYPH) {
+      if (glyph != NULL && glyph->type == IMAGE_GLYPH) {
        if (cursor_type == FILLED_BOX_CURSOR)
          cursor_type = HOLLOW_BOX_CURSOR;
       }
@@ -19348,7 +19348,6 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
   int new_cursor_type;
   int new_cursor_width;
   int active_cursor;
-  struct glyph_matrix *current_glyphs;
   struct glyph_row *glyph_row;
   struct glyph *glyph;
 
@@ -19366,11 +19365,7 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
   if (!on && !w->phys_cursor_on_p)
     return;
 
-  current_glyphs = w->current_matrix;
-  glyph_row = MATRIX_ROW (current_glyphs, vpos);
-  glyph = (glyph_row->cursor_in_fringe_p ? NULL
-          : glyph_row->glyphs[TEXT_AREA] + hpos);
-
+  glyph_row = MATRIX_ROW (w->current_matrix, vpos);
   /* If cursor row is not enabled, we don't really know where to
      display the cursor.  */
   if (!glyph_row->enabled_p)
@@ -19379,6 +19374,11 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
       return;
     }
 
+  glyph = NULL;
+  if (!glyph_row->exact_window_width_line_p
+      || hpos < glyph_row->used[TEXT_AREA])
+    glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
+
   xassert (interrupt_input_blocked);
 
   /* Set new_cursor_type to the cursor we want to be displayed.  */