From: Eli Zaretskii Date: Sun, 9 Sep 2012 20:10:36 +0000 (+0300) Subject: Avoid leaving traces of cursor when entering linum-mode. X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/aba05ce9b6381e3538cfc22dbce7dd7df4ad7342 Avoid leaving traces of cursor when entering linum-mode. 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index e336e3dfe8..2537cd77fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-09-09 Eli Zaretskii + * 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) diff --git a/src/fringe.c b/src/fringe.c index 97d03a2bfa..0c2109a0f8 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -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;