aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-08 07:58:34 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-04-08 08:54:07 +0800
commit191f009ab74111bab6e60ffc1dac5484196b7a6b (patch)
tree0ab212cfd54d1a24000d31a62ed880db257ed747 /src/nvim/testdir
parentb7bc931f631febeeffee528cc3b5667cfbf60a90 (diff)
downloadrneovim-191f009ab74111bab6e60ffc1dac5484196b7a6b.tar.gz
rneovim-191f009ab74111bab6e60ffc1dac5484196b7a6b.tar.bz2
rneovim-191f009ab74111bab6e60ffc1dac5484196b7a6b.zip
vim-patch:8.2.4706: buffer remains active with WinClosed and tabpages
Problem: Buffer remains active if a WinClosed event throws an exception when there are multiple tabpages. Solution: Ignore aborting() when closing the buffer. (closes vim/vim#10101) https://github.com/vim/vim/commit/6a06940f8ae7283999c83ccdf268540220573105
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index ce2ca1322e..c1a120efa4 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -316,6 +316,23 @@ func Test_WinClosed_throws()
augroup! test-WinClosed
endfunc
+func Test_WinClosed_throws_with_tabs()
+ tabnew
+ let bnr = bufnr()
+ call assert_equal(1, bufloaded(bnr))
+ augroup test-WinClosed
+ autocmd WinClosed * throw 'foo'
+ augroup END
+ try
+ close
+ catch /.*/
+ endtry
+ call assert_equal(0, bufloaded(bnr))
+
+ autocmd! test-WinClosed
+ augroup! test-WinClosed
+endfunc
+
func s:AddAnAutocmd()
augroup vimBarTest
au BufReadCmd * echo 'hello'