comparison src/testdir/test_winbuf_close.vim @ 22399:75513701ddd2 v8.2.1748

patch 8.2.1748: closing split window in other tab may cause a crash Commit: https://github.com/vim/vim/commit/f3c51bbff1256a52bdd9ede7887f40062be2628c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 26 19:11:39 2020 +0200 patch 8.2.1748: closing split window in other tab may cause a crash Problem: Closing split window in other tab may cause a crash. Solution: Set tp_curwin properly. (Rob Pilling, closes https://github.com/vim/vim/issues/7018)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Sep 2020 19:15:03 +0200
parents ff21e2962490
children bff3fa5f4c74
comparison
equal deleted inserted replaced
22398:ca9544b14e58 22399:75513701ddd2
190 let l:wid = win_getid() 190 let l:wid = win_getid()
191 tabedit 191 tabedit
192 call win_execute(l:wid, 'close') 192 call win_execute(l:wid, 'close')
193 " Should not crash. 193 " Should not crash.
194 call assert_true(v:true) 194 call assert_true(v:true)
195 %bwipe! 195
196 " This tests closing a window in another tab, while leaving the tab open
197 " i.e. two windows in another tab.
198 tabedit
199 let w:this_win = 42
200 new
201 let othertab_wid = win_getid()
202 tabprevious
203 call win_execute(othertab_wid, 'q')
204 " drawing the tabline helps check that the other tab's windows and buffers
205 " are still valid
206 redrawtabline
207 " but to be certain, ensure we can focus the other tab too
208 tabnext
209 call assert_equal(42, w:this_win)
210
211 bwipe!
196 endfunc 212 endfunc
197 213
198 " Test when closing a split window (above/below) restores space to the window 214 " Test when closing a split window (above/below) restores space to the window
199 " below when 'noequalalways' and 'splitright' are set. 215 " below when 'noequalalways' and 'splitright' are set.
200 func Test_window_close_splitright_noequalalways() 216 func Test_window_close_splitright_noequalalways()