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 #7533)
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 74f8d4c..281c20c 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1013,4 +1013,22 @@
   setlocal keywordprg&
 endfunc
 
+" Test that resetting laststatus does change scroll option
+func Test_opt_reset_scroll()
+  CheckRunVimInTerminal
+  let vimrc =<< trim [CODE]
+    set scroll=2
+    set laststatus=2
+  [CODE]
+  call writefile(vimrc, 'Xscroll')
+  let buf = RunVimInTerminal('-S Xscroll', {'rows': 16, 'cols': 45})
+  call term_sendkeys(buf, ":verbose set scroll?\n")
+  call WaitForAssert({-> assert_match('Last set.*window size', term_getline(buf, 15))})
+  call assert_match('^\s*scroll=7$', term_getline(buf, 14))
+  call StopVimInTerminal(buf)
+
+  " clean up
+  call delete('Xscroll')
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab