aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-04-21 11:46:30 +0100
committerGitHub <noreply@github.com>2023-04-21 11:46:30 +0100
commit3e41121e860f57316673e53a442e12cdd5755f15 (patch)
treefa4c76c50f64934e5989f0c846f7b16b2eff4e15 /src/nvim/option.c
parent05928fe29814516be5537ffa23e8ba7a1f86e0be (diff)
parent44d4f0357341d661a8fa7bd88c244e0ab196a838 (diff)
downloadrneovim-3e41121e860f57316673e53a442e12cdd5755f15.tar.gz
rneovim-3e41121e860f57316673e53a442e12cdd5755f15.tar.bz2
rneovim-3e41121e860f57316673e53a442e12cdd5755f15.zip
Merge pull request #23187 from luukvbaal/statuscolumn
fix(column): rebuild status column when sign column is invalid
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index aff824e9e2..bcb78ea685 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2189,9 +2189,8 @@ static const char *set_bool_option(const int opt_idx, char *const varp, const in
errmsg = did_set_spelllang(curwin);
}
} else if ((int *)varp == &curwin->w_p_nu && *curwin->w_p_stc != NUL) {
- // When 'statuscolumn' is set and 'number' is changed:
- curwin->w_nrwidth_line_count = 0; // make sure width is reset
- curwin->w_statuscol_line_count = 0; // make sure width is re-estimated
+ // When 'number' is changed and 'statuscolumn' is set, make sure width is reset.
+ curwin->w_nrwidth_line_count = 0;
}
if ((int *)varp == &curwin->w_p_arab) {
@@ -5530,6 +5529,13 @@ int win_signcol_configured(win_T *wp, int *is_fixed)
if (*scl == 'n'
&& (*(scl + 1) == 'o' || (*(scl + 1) == 'u'
&& (wp->w_p_nu || wp->w_p_rnu)))) {
+ if (!wp->w_buffer->b_signcols.valid) {
+ FOR_ALL_WINDOWS_IN_TAB(win, curtab) {
+ if (*win->w_p_stc != NUL) {
+ win->w_nrwidth_line_count = 0;
+ }
+ }
+ }
if (*wp->w_p_stc != NUL) {
buf_signcols(wp->w_buffer, 0);
}