Avoid leaving traces of cursor when entering linum-mode.
authorEli Zaretskii <eliz@gnu.org>
Sun, 9 Sep 2012 20:10:36 +0000 (23:10 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 9 Sep 2012 20:10:36 +0000 (23:10 +0300)
 src/fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
 left fringe if the window has a left margin.  This avoids leaving
 traces of the cursor because its leftmost pixel is not drawn over.

src/ChangeLog
src/fringe.c

index e336e3d..2537cd7 100644 (file)
@@ -1,5 +1,9 @@
 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
 
+       * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
+       left fringe if the window has a left margin.  This avoids leaving
+       traces of the cursor because its leftmost pixel is not drawn over.
+
        * dispnew.c (update_window_line): When the left margin area of a
        screen line is updated, set the redraw_fringe_bitmaps_p flag of
        that screen line.  (Bug#12277)
index 97d03a2..0c2109a 100644 (file)
@@ -659,7 +659,14 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
        {
          /* If W has a vertical border to its left, don't draw over it.  */
          wd -= ((!WINDOW_LEFTMOST_P (w)
-                 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
+                 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
+                 /* But don't reduce the fringe width if the window
+                    has a left margin, because that means we are not
+                    in danger of drawing over the vertical border,
+                    and OTOH leaving out that one pixel leaves behind
+                    traces of the cursor, if it was in column zero
+                    before drawing non-empty margin area.  */
+                 && NILP (w->left_margin_cols))
                 ? 1 : 0);
          p.bx = x - wd;
          p.nx = wd;