From 204a8b17c8ebab1619cc47a920a06dcc348d75f7 Mon Sep 17 00:00:00 2001 From: luukvbaal <31730729+luukvbaal@users.noreply.github.com> Date: Sat, 18 Mar 2023 12:44:44 +0100 Subject: fix(column): rebuild status column when sign column is invalidated (#22690) * fix(column): rebuild status column when sign column is invalidated Problem: When implementing a custom sign column through `'statuscolumn'`, the status column is not properly rebuilt when the sign column width changes. Solution: Force a rebuild of the status column when the sign column width is invalidated. * test(column): 'statuscolumn' has correct width when (un)placing signs --- src/nvim/option.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 5fe6e18155..02b32b1fe5 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2176,10 +2176,8 @@ static char *set_bool_option(const int opt_idx, char *const varp, const int valu if (curwin->w_p_spell) { 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 + } else if ((int *)varp == &curwin->w_p_nu) { // 'number' + invalidate_statuscol(curwin, NULL); } if ((int *)varp == &curwin->w_p_arab) { @@ -5519,6 +5517,9 @@ 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_p_stc != NUL) { + buf_signcols(wp->w_buffer, 0); + } return 0; } -- cgit