mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(column): rebuild status column when sign column is invalid
This commit is contained in:
@@ -1397,10 +1397,6 @@ static void win_update(win_T *wp, DecorProviders *providers)
|
|||||||
if (type >= UPD_NOT_VALID) {
|
if (type >= UPD_NOT_VALID) {
|
||||||
wp->w_redr_status = true;
|
wp->w_redr_status = true;
|
||||||
wp->w_lines_valid = 0;
|
wp->w_lines_valid = 0;
|
||||||
if (*wp->w_p_stc != NUL) {
|
|
||||||
wp->w_nrwidth_line_count = 0; // make sure width is reset
|
|
||||||
wp->w_statuscol_line_count = 0; // make sure width is re-estimated
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Window is zero-height: Only need to draw the separator
|
// Window is zero-height: Only need to draw the separator
|
||||||
@@ -2528,6 +2524,7 @@ int number_width(win_T *wp)
|
|||||||
|
|
||||||
// reset for 'statuscolumn'
|
// reset for 'statuscolumn'
|
||||||
if (*wp->w_p_stc != NUL) {
|
if (*wp->w_p_stc != NUL) {
|
||||||
|
wp->w_statuscol_line_count = 0; // make sure width is re-estimated
|
||||||
wp->w_nrwidth_width = (wp->w_p_nu || wp->w_p_rnu) * (int)wp->w_p_nuw;
|
wp->w_nrwidth_width = (wp->w_p_nu || wp->w_p_rnu) * (int)wp->w_p_nuw;
|
||||||
return wp->w_nrwidth_width;
|
return wp->w_nrwidth_width;
|
||||||
}
|
}
|
||||||
|
@@ -2189,9 +2189,8 @@ static const char *set_bool_option(const int opt_idx, char *const varp, const in
|
|||||||
errmsg = did_set_spelllang(curwin);
|
errmsg = did_set_spelllang(curwin);
|
||||||
}
|
}
|
||||||
} else if ((int *)varp == &curwin->w_p_nu && *curwin->w_p_stc != NUL) {
|
} else if ((int *)varp == &curwin->w_p_nu && *curwin->w_p_stc != NUL) {
|
||||||
// When 'statuscolumn' is set and 'number' is changed:
|
// When 'number' is changed and 'statuscolumn' is set, make sure width is reset.
|
||||||
curwin->w_nrwidth_line_count = 0; // make sure width is reset
|
curwin->w_nrwidth_line_count = 0;
|
||||||
curwin->w_statuscol_line_count = 0; // make sure width is re-estimated
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int *)varp == &curwin->w_p_arab) {
|
if ((int *)varp == &curwin->w_p_arab) {
|
||||||
@@ -5531,6 +5530,13 @@ int win_signcol_configured(win_T *wp, int *is_fixed)
|
|||||||
if (*scl == 'n'
|
if (*scl == 'n'
|
||||||
&& (*(scl + 1) == 'o' || (*(scl + 1) == 'u'
|
&& (*(scl + 1) == 'o' || (*(scl + 1) == 'u'
|
||||||
&& (wp->w_p_nu || wp->w_p_rnu)))) {
|
&& (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) {
|
if (*wp->w_p_stc != NUL) {
|
||||||
buf_signcols(wp->w_buffer, 0);
|
buf_signcols(wp->w_buffer, 0);
|
||||||
}
|
}
|
||||||
|
@@ -1202,8 +1202,8 @@ static void did_set_statusline(win_T *win, char **varp, char **gvarp, const char
|
|||||||
if (varp == &p_ruf) { // reset ru_wid first
|
if (varp == &p_ruf) { // reset ru_wid first
|
||||||
ru_wid = 0;
|
ru_wid = 0;
|
||||||
} else if (varp == &win->w_p_stc) {
|
} else if (varp == &win->w_p_stc) {
|
||||||
win->w_nrwidth_line_count = 0; // make sure width is reset
|
// reset 'statuscolumn' width
|
||||||
win->w_statuscol_line_count = 0; // make sure width is re-estimated
|
win->w_nrwidth_line_count = 0;
|
||||||
}
|
}
|
||||||
char *s = *varp;
|
char *s = *varp;
|
||||||
if (varp == &p_ruf && *s == '%') {
|
if (varp == &p_ruf && *s == '%') {
|
||||||
|
@@ -648,6 +648,14 @@ describe('statuscolumn', function()
|
|||||||
2 aaaaa |
|
2 aaaaa |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
|
-- In all windows
|
||||||
|
command('wincmd v | set ls=0')
|
||||||
|
command('sign place 1 line=2 name=sign')
|
||||||
|
screen:expect([[
|
||||||
|
1 ^aaaaa │1 aaaaa |
|
||||||
|
2 ssaaaaa │2 ssaaaaa |
|
||||||
|
|
|
||||||
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("is only evaluated twice, once to estimate and once to draw", function()
|
it("is only evaluated twice, once to estimate and once to draw", function()
|
||||||
|
Reference in New Issue
Block a user