aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/autocmd_spec.lua51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/functional/legacy/autocmd_spec.lua b/test/functional/legacy/autocmd_spec.lua
index 4d82da6312..1071776b68 100644
--- a/test/functional/legacy/autocmd_spec.lua
+++ b/test/functional/legacy/autocmd_spec.lua
@@ -1,5 +1,6 @@
local t = require('test.testutil')
local n = require('test.functional.testnvim')()
+local Screen = require('test.functional.ui.screen')
local clear = n.clear
local write_file = t.write_file
@@ -40,3 +41,53 @@ it('no E440 in quickfix window when autocommand invalidates undo', function()
feed('G')
eq('', api.nvim_get_vvar('errmsg'))
end)
+
+-- oldtest: Test_WinScrolled_Resized_eiw()
+it('WinScrolled and WinResized events can be ignored in a window', function()
+ local screen = Screen.new()
+ n.exec([[
+ call setline(1, ['foo']->repeat(32))
+ set eventignorewin=WinScrolled,WinResized
+ split
+ let [g:afile,g:resized,g:scrolled] = ['none',0,0]
+ au WinScrolled * let [g:afile,g:scrolled] = [expand('<afile>'),g:scrolled+1]
+ au WinResized * let [g:afile,g:resized] = [expand('<afile>'),g:resized+1]
+ ]])
+ feed('<C-W>-')
+ screen:expect([[
+ ^foo |
+ foo |*4
+ {3:[No Name] [+] }|
+ foo |*6
+ {2:[No Name] [+] }|
+ |
+ ]])
+ feed(':echo g:afile g:resized g:scrolled<CR>')
+ screen:expect({ any = 'none 0 0.*' })
+ feed('G')
+ screen:expect([[
+ foo |*4
+ ^foo |
+ {3:[No Name] [+] }|
+ foo |*6
+ {2:[No Name] [+] }|
+ none 0 0 |
+ ]])
+ feed('gg')
+ screen:expect([[
+ ^foo |
+ foo |*4
+ {3:[No Name] [+] }|
+ foo |*6
+ {2:[No Name] [+] }|
+ none 0 0 |
+ ]])
+ feed(':echo g:afile g:resized g:scrolled')
+ screen:expect({ any = ':echo g:afile g:resized g:scrolled.*' })
+ feed('<CR>')
+ screen:expect({ any = 'none 0 0.*' })
+ feed(':set eventignorewin=<CR><C-W>w<C-W>+')
+ screen:expect({ any = ':set eventignorewin=.*' })
+ feed(':echo win_getid() g:afile g:resized g:scrolled<CR>')
+ screen:expect({ any = '1000 1001 1 1.*' })
+end)