diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-04-08 10:23:55 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-08 10:23:55 +0800 |
| commit | 4c9a71c69e60ea6dd4794d1c8ce478f5aa1b3f4d (patch) | |
| tree | 0ab212cfd54d1a24000d31a62ed880db257ed747 /src/nvim/testdir | |
| parent | 65a5cea0d32a006c996cce08b4a25716e0836c57 (diff) | |
| parent | 191f009ab74111bab6e60ffc1dac5484196b7a6b (diff) | |
| download | rneovim-4c9a71c69e60ea6dd4794d1c8ce478f5aa1b3f4d.tar.gz rneovim-4c9a71c69e60ea6dd4794d1c8ce478f5aa1b3f4d.tar.bz2 rneovim-4c9a71c69e60ea6dd4794d1c8ce478f5aa1b3f4d.zip | |
Merge pull request #18031 from zeertzjq/vim-8.2.0004
vim-patch:8.2.{0004,4700,4706}: buffer closing is interrupted
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 34 | ||||
| -rw-r--r-- | src/nvim/testdir/test_trycatch.vim | 27 |
2 files changed, 59 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 76c69ad10b..c1a120efa4 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -299,6 +299,40 @@ func Test_WinClosed() unlet g:triggered endfunc +func Test_WinClosed_throws() + vnew + 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 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' diff --git a/src/nvim/testdir/test_trycatch.vim b/src/nvim/testdir/test_trycatch.vim index 7e513180a3..adc1745b39 100644 --- a/src/nvim/testdir/test_trycatch.vim +++ b/src/nvim/testdir/test_trycatch.vim @@ -1972,6 +1972,29 @@ func Test_builtin_func_error() call assert_equal('jlmnpqrtueghivyzACD', g:Xpath) endfunc -" Modelines {{{1 +func Test_reload_in_try_catch() + call writefile(['x'], 'Xreload') + set autoread + edit Xreload + tabnew + call writefile(['xx'], 'Xreload') + augroup ReLoad + au FileReadPost Xreload let x = doesnotexist + au BufReadPost Xreload let x = doesnotexist + augroup END + try + edit Xreload + catch + endtry + tabnew + + tabclose + tabclose + autocmd! ReLoad + set noautoread + bwipe! Xreload + call delete('Xreload') +endfunc + +" Modeline {{{1 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker -"------------------------------------------------------------------------------- |