fix(column): issues with 'statuscolumn' width (#22542)

Problem:    'statuscolumn' width can be incorrect when toggling 'number'
            or setting 'statuscolumn'.
Solution:   Make sure the width is reset and re-estimated when
            'statuscolumn' and 'number' are set. (When 'relativenumber'
            is set this already happens because it always changes
            "nrwidth_line_count".)
This commit is contained in:
luukvbaal
2023-03-07 01:45:08 +01:00
committed by GitHub
parent 39096f48f0
commit bf4eada2c8
3 changed files with 43 additions and 0 deletions

View File

@@ -1199,6 +1199,7 @@ static void did_set_statusline(win_T *win, char **varp, char **gvarp, char **err
ru_wid = 0;
} else if (varp == &win->w_p_stc) {
win->w_nrwidth_line_count = 0;
win->w_statuscol_line_count = 0;
}
char *s = *varp;
if (varp == &p_ruf && *s == '%') {