diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-08-09 16:19:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-09 16:19:11 +0200 |
commit | 602e7505e2cd47ce0f45236a5175709d8ce2c489 (patch) | |
tree | 64a4c0408200bc3af4bbe24819dfe9c20fae75ef /src/nvim/option.c | |
parent | 1869f86e358b64eae69bbd004ab4822bdcc54870 (diff) | |
parent | 73340c1ce2ac44acd1604536ab9097f19b62e4ae (diff) | |
download | rneovim-602e7505e2cd47ce0f45236a5175709d8ce2c489.tar.gz rneovim-602e7505e2cd47ce0f45236a5175709d8ce2c489.tar.bz2 rneovim-602e7505e2cd47ce0f45236a5175709d8ce2c489.zip |
Merge pull request #12621 from Shougo/vim-8.1.1564
[RDY] vim-patch:8.1.1564, 1570, 1623, 1712 : sign column takes up space
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index d789ad3587..2862419177 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -314,7 +314,7 @@ static char *(p_icm_values[]) = { "nosplit", "split", NULL }; static char *(p_scl_values[]) = { "yes", "no", "auto", "auto:1", "auto:2", "auto:3", "auto:4", "auto:5", "auto:6", "auto:7", "auto:8", "auto:9", "yes:1", "yes:2", "yes:3", "yes:4", "yes:5", "yes:6", "yes:7", "yes:8", - "yes:9", NULL }; + "yes:9", "number", NULL }; static char *(p_fdc_values[]) = { "auto:1", "auto:2", "auto:3", "auto:4", "auto:5", "auto:6", "auto:7", "auto:8", "auto:9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; @@ -3183,6 +3183,13 @@ ambw_end: if (check_opt_strings(*varp, p_scl_values, false) != OK) { errmsg = e_invarg; } + // When changing the 'signcolumn' to or from 'number', recompute the + // width of the number column if 'number' or 'relativenumber' is set. + if (((*oldval == 'n' && *(oldval + 1) == 'u') + || (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) =='u')) + && (curwin->w_p_nu || curwin->w_p_rnu)) { + curwin->w_nrwidth_line_count = 0; + } } else if (varp == &curwin->w_p_fdc || varp == &curwin->w_allbuf_opt.wo_fdc) { // 'foldcolumn' if (check_opt_strings(*varp, p_fdc_values, false) != OK) { @@ -7397,7 +7404,10 @@ int win_signcol_count(win_T *wp) int maximum = 1, needed_signcols; const char *scl = (const char *)wp->w_p_scl; - if (*scl == 'n') { + // Note: It checks "no" or "number" in 'signcolumn' option + if (*scl == 'n' + && (*(scl + 1) == 'o' || (*(scl + 1) == 'u' + && (wp->w_p_nu || wp->w_p_rnu)))) { return 0; } needed_signcols = buf_signcols(wp->w_buffer); |