Patch 8.1.1910

10 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 22, 2019, 3:24:11 PM8/22/19
to vim...@googlegroups.com

Patch 8.1.1910
Problem: Redrawing too much when toggling 'relativenumber'.
Solution: Only clear when 'signcolumn' is set to "number". (Yegappan
Lakshmanan, closes #4852)
Files: src/option.c


*** ../vim-8.1.1909/src/option.c 2019-08-21 14:36:29.391376081 +0200
--- src/option.c 2019-08-22 21:20:16.900200051 +0200
***************
*** 1986,1992 ****
(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,
(char_u *)VAR_WIN, PV_NU,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM,
--- 1986,1992 ----
(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,
(char_u *)VAR_WIN, PV_NU,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM,
***************
*** 2254,2260 ****
{"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,
(char_u *)VAR_WIN, PV_RNU,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"remap", NULL, P_BOOL|P_VI_DEF,
--- 2254,2260 ----
{"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,
(char_u *)VAR_WIN, PV_RNU,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"remap", NULL, P_BOOL|P_VI_DEF,
***************
*** 9005,9010 ****
--- 9005,9028 ----

#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)
*** ../vim-8.1.1909/src/version.c 2019-08-21 22:49:48.111267837 +0200
--- src/version.c 2019-08-22 21:22:24.495604584 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1910,
/**/

--
hundred-and-one symptoms of being an internet addict:
92. It takes you two hours to check all 14 of your mailboxes.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages