aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-27 08:57:57 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-03-27 10:01:07 +0800
commitf4f18a983305d3cf8a6028333e9b99e86283032b (patch)
tree93272007351ed4c95eb46910e14ba69b8f4e6b7c /src/nvim/testdir
parenta490db5ba819218e9188cbb51d885dbf3a194000 (diff)
downloadrneovim-f4f18a983305d3cf8a6028333e9b99e86283032b.tar.gz
rneovim-f4f18a983305d3cf8a6028333e9b99e86283032b.tar.bz2
rneovim-f4f18a983305d3cf8a6028333e9b99e86283032b.zip
vim-patch:8.2.4631: crash when switching window in BufWipeout autocommand
Problem: Crash when switching window in BufWipeout autocommand. Solution: Put any buffer in the window to avoid it being NULL. (closes vim/vim#10024) https://github.com/vim/vim/commit/347538fad0c503249ebdedd5884c2081257c9f61 win_init_empty() cannot be made static because it is used in autocmd.c
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 d4005e41e8..76c69ad10b 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -2611,4 +2611,21 @@ func Test_autocmd_closing_cmdwin()
only
endfunc
+func Test_bufwipeout_changes_window()
+ " This should not crash, but we don't have any expectations about what
+ " happens, changing window in BufWipeout has unpredictable results.
+ tabedit
+ let g:window_id = win_getid()
+ topleft new
+ setlocal bufhidden=wipe
+ autocmd BufWipeout <buffer> call win_gotoid(g:window_id)
+ tabprevious
+ +tabclose
+
+ unlet g:window_id
+ au! BufWipeout
+ %bwipe!
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab