diff src/testdir/test_options.vim @ 23386:3105546b941f v8.2.2236

patch 8.2.2236: 'scroll' option can change when setting the statusline Commit: https://github.com/vim/vim/commit/746670604a60cb0356b56c112ffb6d297c679099 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 28 15:41:41 2020 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Dec 2020 15:45:03 +0100
parents 47a5349168ea
children 2a5b9801f2e2
line wrap: on
line diff
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1013,4 +1013,22 @@ func Test_isfname_with_options()
   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