summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-22 21:23:20 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-22 21:23:20 +0200
commit448262176b382c63bd2faa9a1354670a4eede36b (patch)
treed43073ca7ce3f69eed467b5606b71ac399d3fe53
parente49fbff384e45dd17fed72321c26937edf6de16b (diff)
downloadvim-git-448262176b382c63bd2faa9a1354670a4eede36b.tar.gz
patch 8.1.1910: redrawing too much when toggling 'relativenumber'v8.1.1910
Problem: Redrawing too much when toggling 'relativenumber'. Solution: Only clear when 'signcolumn' is set to "number". (Yegappan Lakshmanan, closes #4852)
-rw-r--r--src/option.c22
-rw-r--r--src/version.c2
2 files changed, 22 insertions, 2 deletions
diff --git a/src/option.c b/src/option.c
index b625587db..6d3a059cc 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1986,7 +1986,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_RCLR,
+ {"number", "nu", P_BOOL|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_NU,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM,
@@ -2254,7 +2254,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_RCLR,
+ {"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RWIN,
(char_u *)VAR_WIN, PV_RNU,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"remap", NULL, P_BOOL|P_VI_DEF,
@@ -9005,6 +9005,24 @@ set_bool_option(
#endif
+#if defined(FEAT_SIGNS) && defined(FEAT_GUI)
+ else if (((int *)varp == &curwin->w_p_nu
+ || (int *)varp == &curwin->w_p_rnu)
+ && gui.in_use
+ && (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) == 'u')
+ && curbuf->b_signlist != NULL)
+ {
+ // If the 'number' or 'relativenumber' options are modified and
+ // 'signcolumn' is set to 'number', then clear the screen for a full
+ // refresh. Otherwise the sign icons are not displayed properly in the
+ // number column. If the 'number' option is set and only the
+ // 'relativenumber' option is toggled, then don't refresh the screen
+ // (optimization).
+ if (!(curwin->w_p_nu && ((int *)varp == &curwin->w_p_rnu)))
+ redraw_all_later(CLEAR);
+ }
+#endif
+
#ifdef FEAT_TERMGUICOLORS
/* 'termguicolors' */
else if ((int *)varp == &p_tgc)
diff --git a/src/version.c b/src/version.c
index 37b0f7978..98f368ca0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1910,
+/**/
1909,
/**/
1908,