summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-08 14:44:50 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-08 14:44:50 +0200
commit0ea5070d79c8a13fb2403280a72f968495b0fab7 (patch)
treeb75f6e705f210716e624e65bcdb07da869784d2b /src/testdir
parent710b4a16465fb38492801a0dccf2293397aadc6a (diff)
patch 8.0.0700: segfault with QuitPre autocommand closes the windowv8.0.0700
Problem: Segfault with QuitPre autocommand closes the window. (Marek) Solution: Check that the window pointer is still valid. (Christian Brabandt, closes #1817)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_tabpage.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim
index c139958df3..239b1b965b 100644
--- a/src/testdir/test_tabpage.vim
+++ b/src/testdir/test_tabpage.vim
@@ -473,5 +473,23 @@ func Test_tabnext_on_buf_unload2()
endwhile
endfunc
+func Test_close_on_quitpre()
+ " This once caused a crash
+ new
+ only
+ set bufhidden=delete
+ au QuitPre <buffer> close
+ tabnew tab1
+ tabnew tab2
+ 1tabn
+ q!
+ call assert_equal(1, tabpagenr())
+ call assert_equal(2, tabpagenr('$'))
+ " clean up
+ while tabpagenr('$') > 1
+ bwipe!
+ endwhile
+ 1b
+endfunc
" vim: shiftwidth=2 sts=2 expandtab