terminal: disable 'scrolloff' (fixes flicker)

Besides the special-case in get_scrolloff_value(), it makes sense for
'scrolloff' and 'sidescrolloff' to reflect the correct values (for
plugins, scripts, …).

ref 53d607af9c53accfd634435908fb79061f1212b9
ref #11915
ref #12230
This commit is contained in:
Justin M. Keyes
2020-05-04 21:04:47 -07:00
parent edd5b233d8
commit 7b764bb43d
3 changed files with 26 additions and 1 deletions

View File

@@ -17,6 +17,18 @@ describe(':terminal buffer', function()
screen = thelpers.screen_setup()
end)
it('terminal-mode forces various options', function()
feed([[<C-\><C-N>]])
command('setlocal cursorline cursorcolumn scrolloff=4 sidescrolloff=7')
eq({ 1, 1, 4, 7 }, eval('[&l:cursorline, &l:cursorcolumn, &l:scrolloff, &l:sidescrolloff]'))
eq('n', eval('mode()'))
-- Enter terminal-mode ("insert" mode in :terminal).
feed('i')
eq('t', eval('mode()'))
eq({ 0, 0, 0, 0 }, eval('[&l:cursorline, &l:cursorcolumn, &l:scrolloff, &l:sidescrolloff]'))
end)
describe('when a new file is edited', function()
before_each(function()
feed('<c-\\><c-n>:set bufhidden=wipe<cr>:enew<cr>')