]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
Merge changes from emacs-23 branch
[gnu-emacs] / src / xdisp.c
index fbf30092ca175372656d46b7d15a266c8c4571d2..921a332fdc6a08aa1bf2770d1766ec628a9f17cd 100644 (file)
@@ -5812,7 +5812,7 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p)
   else if (skipped_p)
     {
       reseat (it, it->current.pos, 0);
-      if (it->bidi_p)
+      if (it->bidi_p && !STRINGP (it->string))
        {
          it->bidi_it.new_paragraph = new_paragraph;
          it->bidi_it.first_elt = first_elt;
@@ -27261,7 +27261,7 @@ expose_window (struct window *w, XRectangle *fr)
     {
       int yb = window_text_bottom_y (w);
       struct glyph_row *row;
-      int cursor_cleared_p;
+      int cursor_cleared_p, phys_cursor_on_p;
       struct glyph_row *first_overlapping_row, *last_overlapping_row;
 
       TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n",
@@ -27281,6 +27281,13 @@ expose_window (struct window *w, XRectangle *fr)
       else
        cursor_cleared_p = 0;
 
+      /* If the row containing the cursor extends face to end of line,
+        then expose_area might overwrite the cursor outside the
+        rectangle and thus notice_overwritten_cursor might clear
+        w->phys_cursor_on_p.  We remember the original value and
+        check later if it is changed.  */
+      phys_cursor_on_p = w->phys_cursor_on_p;
+
       /* Update lines intersecting rectangle R.  */
       first_overlapping_row = last_overlapping_row = NULL;
       for (row = w->current_matrix->rows;
@@ -27347,7 +27354,8 @@ expose_window (struct window *w, XRectangle *fr)
          x_draw_vertical_border (w);
 
          /* Turn the cursor on again.  */
-         if (cursor_cleared_p)
+         if (cursor_cleared_p
+             || (phys_cursor_on_p && !w->phys_cursor_on_p))
            update_window_cursor (w, 1);
        }
     }