Skip to content

Commit 2b044ff

Browse files
committed
patch 8.1.1587: redraw problem when sign icons in the number column
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)
1 parent b2cda0d commit 2b044ff

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/gui.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2253,6 +2253,7 @@ gui_outstr_nowrap(
22532253
int col = gui.col;
22542254
#ifdef FEAT_SIGN_ICONS
22552255
int draw_sign = FALSE;
2256+
int signcol = 0;
22562257
char_u extra[18];
22572258
# ifdef FEAT_NETBEANS_INTG
22582259
int multi_sign = FALSE;
@@ -2287,6 +2288,8 @@ gui_outstr_nowrap(
22872288
if (len == 1 && col > 0)
22882289
--col;
22892290
len = (int)STRLEN(s);
2291+
if (len > 2)
2292+
signcol = len - 3; // Right align sign icon in the number column
22902293
draw_sign = TRUE;
22912294
highlight_mask = 0;
22922295
}
@@ -2612,7 +2615,7 @@ gui_outstr_nowrap(
26122615
#ifdef FEAT_SIGN_ICONS
26132616
if (draw_sign)
26142617
/* Draw the sign on top of the spaces. */
2615-
gui_mch_drawsign(gui.row, col, gui.highlight_mask);
2618+
gui_mch_drawsign(gui.row, signcol, gui.highlight_mask);
26162619
# if defined(FEAT_NETBEANS_INTG) && (defined(FEAT_GUI_X11) \
26172620
|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN))
26182621
if (multi_sign)

src/option.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ static struct vimoption options[] =
19851985
(char_u *)&p_nf, PV_NF,
19861986
{(char_u *)"bin,octal,hex", (char_u *)0L}
19871987
SCTX_INIT},
1988-
{"number", "nu", P_BOOL|P_VI_DEF|P_RWIN,
1988+
{"number", "nu", P_BOOL|P_VI_DEF|P_RCLR,
19891989
(char_u *)VAR_WIN, PV_NU,
19901990
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
19911991
{"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM,
@@ -2252,7 +2252,7 @@ static struct vimoption options[] =
22522252
{"regexpengine", "re", P_NUM|P_VI_DEF,
22532253
(char_u *)&p_re, PV_NONE,
22542254
{(char_u *)0L, (char_u *)0L} SCTX_INIT},
2255-
{"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RWIN,
2255+
{"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RCLR,
22562256
(char_u *)VAR_WIN, PV_RNU,
22572257
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
22582258
{"remap", NULL, P_BOOL|P_VI_DEF,
@@ -2497,7 +2497,7 @@ static struct vimoption options[] =
24972497
{"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
24982498
(char_u *)&p_siso, PV_SISO,
24992499
{(char_u *)0L, (char_u *)0L} SCTX_INIT},
2500-
{"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN,
2500+
{"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RCLR,
25012501
#ifdef FEAT_SIGNS
25022502
(char_u *)VAR_WIN, PV_SCL,
25032503
{(char_u *)"auto", (char_u *)0L}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1587,
780782
/**/
781783
1586,
782784
/**/

0 commit comments

Comments
 (0)