vim-patch:8.2.2236: 'scroll' option can change when setting the statusline

Problem:    'scroll' option can change when setting the statusline or tabline
            but the option context is not updated.
Solution:   Update the script context when the scroll option is changed as a
            side effect. (Christian Brabandt, closes vim/vim#7533)
746670604a
This commit is contained in:
Jan Edmund Lazo
2021-03-01 23:01:09 -05:00
parent a5bacdbfb4
commit f32acc70e8
6 changed files with 66 additions and 5 deletions

View File

@@ -5960,9 +5960,17 @@ void win_new_width(win_T *wp, int width)
void win_comp_scroll(win_T *wp)
{
const long old_w_p_scr = wp->w_p_scr;
wp->w_p_scr = wp->w_height / 2;
if (wp->w_p_scr == 0)
if (wp->w_p_scr == 0) {
wp->w_p_scr = 1;
}
if (wp->w_p_scr != old_w_p_scr) {
// Used by "verbose set scroll".
wp->w_p_script_ctx[WV_SCROLL].script_ctx.sc_sid = SID_WINLAYOUT;
wp->w_p_script_ctx[WV_SCROLL].script_ctx.sc_lnum = 0;
}
}
/*