Mercurial > vim
comparison src/option.c @ 17827:6de5558c5242 v8.1.1910
patch 8.1.1910: redrawing too much when toggling 'relativenumber'
Commit: https://github.com/vim/vim/commit/448262176b382c63bd2faa9a1354670a4eede36b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 22 21:23:20 2019 +0200
patch 8.1.1910: redrawing too much when toggling 'relativenumber'
Problem: Redrawing too much when toggling 'relativenumber'.
Solution: Only clear when 'signcolumn' is set to "number". (Yegappan
Lakshmanan, closes #4852)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 22 Aug 2019 21:30:03 +0200 |
parents | 59f8948b7590 |
children | 8377ec7c5824 |
comparison
equal
deleted
inserted
replaced
17826:f2a1c7de4d14 | 17827:6de5558c5242 |
---|---|
1984 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, | 1984 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, |
1985 {"nrformats", "nf", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, | 1985 {"nrformats", "nf", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, |
1986 (char_u *)&p_nf, PV_NF, | 1986 (char_u *)&p_nf, PV_NF, |
1987 {(char_u *)"bin,octal,hex", (char_u *)0L} | 1987 {(char_u *)"bin,octal,hex", (char_u *)0L} |
1988 SCTX_INIT}, | 1988 SCTX_INIT}, |
1989 {"number", "nu", P_BOOL|P_VI_DEF|P_RCLR, | 1989 {"number", "nu", P_BOOL|P_VI_DEF|P_RWIN, |
1990 (char_u *)VAR_WIN, PV_NU, | 1990 (char_u *)VAR_WIN, PV_NU, |
1991 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, | 1991 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, |
1992 {"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM, | 1992 {"numberwidth", "nuw", P_NUM|P_RWIN|P_VIM, |
1993 #ifdef FEAT_LINEBREAK | 1993 #ifdef FEAT_LINEBREAK |
1994 (char_u *)VAR_WIN, PV_NUW, | 1994 (char_u *)VAR_WIN, PV_NUW, |
2252 #endif | 2252 #endif |
2253 {(char_u *)2000L, (char_u *)0L} SCTX_INIT}, | 2253 {(char_u *)2000L, (char_u *)0L} SCTX_INIT}, |
2254 {"regexpengine", "re", P_NUM|P_VI_DEF, | 2254 {"regexpengine", "re", P_NUM|P_VI_DEF, |
2255 (char_u *)&p_re, PV_NONE, | 2255 (char_u *)&p_re, PV_NONE, |
2256 {(char_u *)0L, (char_u *)0L} SCTX_INIT}, | 2256 {(char_u *)0L, (char_u *)0L} SCTX_INIT}, |
2257 {"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RCLR, | 2257 {"relativenumber", "rnu", P_BOOL|P_VI_DEF|P_RWIN, |
2258 (char_u *)VAR_WIN, PV_RNU, | 2258 (char_u *)VAR_WIN, PV_RNU, |
2259 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, | 2259 {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, |
2260 {"remap", NULL, P_BOOL|P_VI_DEF, | 2260 {"remap", NULL, P_BOOL|P_VI_DEF, |
2261 (char_u *)&p_remap, PV_NONE, | 2261 (char_u *)&p_remap, PV_NONE, |
2262 {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, | 2262 {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, |
9003 } | 9003 } |
9004 } | 9004 } |
9005 | 9005 |
9006 #endif | 9006 #endif |
9007 | 9007 |
9008 #if defined(FEAT_SIGNS) && defined(FEAT_GUI) | |
9009 else if (((int *)varp == &curwin->w_p_nu | |
9010 || (int *)varp == &curwin->w_p_rnu) | |
9011 && gui.in_use | |
9012 && (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) == 'u') | |
9013 && curbuf->b_signlist != NULL) | |
9014 { | |
9015 // If the 'number' or 'relativenumber' options are modified and | |
9016 // 'signcolumn' is set to 'number', then clear the screen for a full | |
9017 // refresh. Otherwise the sign icons are not displayed properly in the | |
9018 // number column. If the 'number' option is set and only the | |
9019 // 'relativenumber' option is toggled, then don't refresh the screen | |
9020 // (optimization). | |
9021 if (!(curwin->w_p_nu && ((int *)varp == &curwin->w_p_rnu))) | |
9022 redraw_all_later(CLEAR); | |
9023 } | |
9024 #endif | |
9025 | |
9008 #ifdef FEAT_TERMGUICOLORS | 9026 #ifdef FEAT_TERMGUICOLORS |
9009 /* 'termguicolors' */ | 9027 /* 'termguicolors' */ |
9010 else if ((int *)varp == &p_tgc) | 9028 else if ((int *)varp == &p_tgc) |
9011 { | 9029 { |
9012 # ifdef FEAT_VTP | 9030 # ifdef FEAT_VTP |