aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/autocmd/winscrolled_spec.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/functional/autocmd/winscrolled_spec.lua b/test/functional/autocmd/winscrolled_spec.lua
index 01c2631b62..5c1b758961 100644
--- a/test/functional/autocmd/winscrolled_spec.lua
+++ b/test/functional/autocmd/winscrolled_spec.lua
@@ -6,12 +6,14 @@ local eval = helpers.eval
local command = helpers.command
local feed = helpers.feed
local meths = helpers.meths
+local assert_alive = helpers.assert_alive
+
+before_each(clear)
describe('WinScrolled', function()
local win_id
before_each(function()
- clear()
win_id = meths.get_current_win().id
command(string.format('autocmd WinScrolled %d let g:matched = v:true', win_id))
command('let g:scrolled = 0')
@@ -72,3 +74,12 @@ describe('WinScrolled', function()
eq(1, eval('g:scrolled'))
end)
end)
+
+it('closing window in WinScrolled does not cause use-after-free #13265', function()
+ local lines = {'aaa', 'bbb'}
+ meths.buf_set_lines(0, 0, -1, true, lines)
+ command('vsplit')
+ command('autocmd WinScrolled * close')
+ feed('<C-E>')
+ assert_alive()
+end)