]> granicus.if.org Git - vim/commitdiff
patch 8.1.1587: redraw problem when sign icons in the number column v8.1.1587
authorBram Moolenaar <Bram@vim.org>
Mon, 24 Jun 2019 03:45:14 +0000 (05:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 24 Jun 2019 03:45:14 +0000 (05:45 +0200)
Problem:    Redraw problem when sign icons in the number column.
Solution:   Clear and redraw when changing related options.  Right aligh the
            sign icon in the GUI. (Yegappan Lakshmanan, closes #4578)

src/gui.c
src/option.c
src/version.c

index 56891822773e9718c64b04a280ac17c845e71f04..634f3fbc54bb4d55c9813575a42e3b0f613daf45 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -2253,6 +2253,7 @@ gui_outstr_nowrap(
     int                col = gui.col;
 #ifdef FEAT_SIGN_ICONS
     int                draw_sign = FALSE;
+    int                signcol = 0;
     char_u     extra[18];
 # ifdef FEAT_NETBEANS_INTG
     int                multi_sign = FALSE;
@@ -2287,6 +2288,8 @@ gui_outstr_nowrap(
        if (len == 1 && col > 0)
            --col;
        len = (int)STRLEN(s);
+       if (len > 2)
+           signcol = len - 3;  // Right align sign icon in the number column
        draw_sign = TRUE;
        highlight_mask = 0;
     }
@@ -2612,7 +2615,7 @@ gui_outstr_nowrap(
 #ifdef FEAT_SIGN_ICONS
     if (draw_sign)
        /* Draw the sign on top of the spaces. */
-       gui_mch_drawsign(gui.row, col, gui.highlight_mask);
+       gui_mch_drawsign(gui.row, signcol, gui.highlight_mask);
 # if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_X11) \
        || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN))
     if (multi_sign)
index a1cddcf59eca04736b17a738c5dd034e89b08741..941ea66ff9bd60b1bf816dd16cc31edddfcc4905 100644 (file)
@@ -1985,7 +1985,7 @@ static struct vimoption options[] =
                            (char_u *)&p_nf, PV_NF,
                            {(char_u *)"bin,octal,hex", (char_u *)0L}
                            SCTX_INIT},
-    {"number",     "nu",   P_BOOL|P_VI_DEF|P_RWIN,
+    {"number",     "nu",   P_BOOL|P_VI_DEF|P_RCLR,
                            (char_u *)VAR_WIN, PV_NU,
                            {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
     {"numberwidth", "nuw",  P_NUM|P_RWIN|P_VIM,
@@ -2252,7 +2252,7 @@ static struct vimoption options[] =
     {"regexpengine", "re",  P_NUM|P_VI_DEF,
                            (char_u *)&p_re, PV_NONE,
                            {(char_u *)0L, (char_u *)0L} SCTX_INIT},
-    {"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RWIN,
+    {"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RCLR,
                            (char_u *)VAR_WIN, PV_RNU,
                            {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
     {"remap",      NULL,   P_BOOL|P_VI_DEF,
@@ -2497,7 +2497,7 @@ static struct vimoption options[] =
     {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
                            (char_u *)&p_siso, PV_SISO,
                            {(char_u *)0L, (char_u *)0L} SCTX_INIT},
-    {"signcolumn",   "scl",  P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN,
+    {"signcolumn",   "scl",  P_STRING|P_ALLOCED|P_VI_DEF|P_RCLR,
 #ifdef FEAT_SIGNS
                            (char_u *)VAR_WIN, PV_SCL,
                            {(char_u *)"auto", (char_u *)0L}
index 9d2f26cbb26bd8aa9a5289bc02fd1e932b0843ce..37f9e61c61bc787f34d362f0bf7378352f687d5b 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1587,
 /**/
     1586,
 /**/