aboutsummaryrefslogtreecommitdiff
path: root/test/functional/autocmd/cursormoved_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/autocmd/cursormoved_spec.lua')
-rw-r--r--test/functional/autocmd/cursormoved_spec.lua18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/functional/autocmd/cursormoved_spec.lua b/test/functional/autocmd/cursormoved_spec.lua
index 85d8628d7e..64b63c3205 100644
--- a/test/functional/autocmd/cursormoved_spec.lua
+++ b/test/functional/autocmd/cursormoved_spec.lua
@@ -5,19 +5,23 @@ local eq = helpers.eq
local eval = helpers.eval
local funcs = helpers.funcs
local source = helpers.source
+local command = helpers.command
describe('CursorMoved', function()
before_each(clear)
- it('is triggered by changing windows', function()
+ it('is triggered after BufEnter when changing or splitting windows #11878 #12031', function()
source([[
- let g:cursormoved = 0
- vsplit
- autocmd CursorMoved * let g:cursormoved += 1
- wincmd w
- wincmd w
+ call setline(1, 'foo')
+ let g:log = []
+ autocmd BufEnter * let g:log += ['BufEnter' .. expand("<abuf>")]
+ autocmd CursorMoved * let g:log += ['CursorMoved' .. expand("<abuf>")]
]])
- eq(2, eval('g:cursormoved'))
+ eq({}, eval('g:log'))
+ command('new')
+ eq({'BufEnter2', 'CursorMoved2'}, eval('g:log'))
+ command('wincmd w')
+ eq({'BufEnter2', 'CursorMoved2', 'BufEnter1', 'CursorMoved1'}, eval('g:log'))
end)
it("is not triggered by functions that don't change the window", function()