summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-28 15:41:41 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-28 15:41:41 +0100
commit746670604a60cb0356b56c112ffb6d297c679099 (patch)
treebf0cdf7021500f0e39af0a7edb9d22dcc4bb9849 /src/window.c
parentdace9f785fca6cc802b2fb7f11a5ee4fab896432 (diff)
downloadvim-git-746670604a60cb0356b56c112ffb6d297c679099.tar.gz
patch 8.2.2236: 'scroll' option can change when setting the statuslinev8.2.2236
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 #7533)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 1134d0a6c..1cf795fd7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6325,9 +6325,21 @@ win_new_width(win_T *wp, int width)
void
win_comp_scroll(win_T *wp)
{
+#if defined(FEAT_EVAL)
+ int old_w_p_scr = wp->w_p_scr;
+#endif
+
wp->w_p_scr = ((unsigned)wp->w_height >> 1);
if (wp->w_p_scr == 0)
wp->w_p_scr = 1;
+#if defined(FEAT_EVAL)
+ if (wp->w_p_scr != old_w_p_scr)
+ {
+ // Used by "verbose set scroll".
+ wp->w_p_script_ctx[WV_SCROLL].sc_sid = SID_WINLAYOUT;
+ wp->w_p_script_ctx[WV_SCROLL].sc_lnum = 0;
+ }
+#endif
}
/*