diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-09-23 08:02:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 08:02:12 +0800 |
commit | 9aead1f670f42bac754709215fbab32397a202b0 (patch) | |
tree | 6fca35b20fd84ce30df1df89bb442239711b0620 /test/functional/editor/tabpage_spec.lua | |
parent | 0760379b413ca95b80ed2970b49f14ba3b1acbf9 (diff) | |
parent | d7052e8e1f0311113199ae5c25886fa9690367e4 (diff) | |
download | rneovim-9aead1f670f42bac754709215fbab32397a202b0.tar.gz rneovim-9aead1f670f42bac754709215fbab32397a202b0.tar.bz2 rneovim-9aead1f670f42bac754709215fbab32397a202b0.zip |
Merge pull request #20299 from zeertzjq/vim-9.0.0550
vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
Diffstat (limited to 'test/functional/editor/tabpage_spec.lua')
-rw-r--r-- | test/functional/editor/tabpage_spec.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua index 849a02c28b..01779a9a92 100644 --- a/test/functional/editor/tabpage_spec.lua +++ b/test/functional/editor/tabpage_spec.lua @@ -9,6 +9,9 @@ local feed = helpers.feed local eval = helpers.eval local exec = helpers.exec local funcs = helpers.funcs +local meths = helpers.meths +local curwin = helpers.curwin +local assert_alive = helpers.assert_alive describe('tabpage', function() before_each(clear) @@ -54,6 +57,45 @@ describe('tabpage', function() neq(999, eval('g:win_closed')) end) + it('no segfault with strange WinClosed autocommand #20290', function() + pcall(exec, [[ + set nohidden + edit Xa + split Xb + tab split + new + autocmd WinClosed * tabprev | bwipe! + close + ]]) + assert_alive() + end) + + it('nvim_win_close and nvim_win_hide update tabline #20285', function() + eq(1, #meths.list_tabpages()) + eq({1, 1}, funcs.win_screenpos(0)) + local win1 = curwin().id + + command('tabnew') + eq(2, #meths.list_tabpages()) + eq({2, 1}, funcs.win_screenpos(0)) + local win2 = curwin().id + + meths.win_close(win1, true) + eq(win2, curwin().id) + eq(1, #meths.list_tabpages()) + eq({1, 1}, funcs.win_screenpos(0)) + + command('tabnew') + eq(2, #meths.list_tabpages()) + eq({2, 1}, funcs.win_screenpos(0)) + local win3 = curwin().id + + meths.win_close(win2, true) + eq(win3, curwin().id) + eq(1, #meths.list_tabpages()) + eq({1, 1}, funcs.win_screenpos(0)) + end) + it('switching tabpage after setting laststatus=3 #19591', function() local screen = Screen.new(40, 8) screen:set_default_attr_ids({ |