Mercurial > vim
comparison src/testdir/test_autocmd.vim @ 30429:69ff2bd737a9 v9.0.0550
patch 9.0.0550: crash when closing a tabpage and buffer is NULL
Commit: https://github.com/vim/vim/commit/62de54b48d6354d4622ec0b21ffa4cf3cf312505
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Sep 22 18:08:37 2022 +0100
patch 9.0.0550: crash when closing a tabpage and buffer is NULL
Problem: Crash when closing a tabpage and buffer is NULL.
Solution: Adjust how autocommands are triggered when closing a window.
(closes #11198, closes #11197)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 22 Sep 2022 19:15:03 +0200 |
parents | dc238f2c7355 |
children | 7ab65e398be7 |
comparison
equal
deleted
inserted
replaced
30428:e57e07951f98 | 30429:69ff2bd737a9 |
---|---|
511 endtry | 511 endtry |
512 call assert_equal(0, bufloaded(bnr)) | 512 call assert_equal(0, bufloaded(bnr)) |
513 | 513 |
514 autocmd! test-WinClosed | 514 autocmd! test-WinClosed |
515 augroup! test-WinClosed | 515 augroup! test-WinClosed |
516 endfunc | |
517 | |
518 " This used to trigger WinClosed twice for the same window, and the window's | |
519 " buffer was NULL in the second autocommand. | |
520 func Test_WinClosed_switch_tab() | |
521 edit Xa | |
522 split Xb | |
523 split Xc | |
524 tab split | |
525 new | |
526 augroup test-WinClosed | |
527 autocmd WinClosed * tabprev | bwipe! | |
528 augroup END | |
529 close | |
530 " Check that the tabline has been fully removed | |
531 call assert_equal([1, 1], win_screenpos(0)) | |
532 | |
533 autocmd! test-WinClosed | |
534 augroup! test-WinClosed | |
535 %bwipe! | |
516 endfunc | 536 endfunc |
517 | 537 |
518 func s:AddAnAutocmd() | 538 func s:AddAnAutocmd() |
519 augroup vimBarTest | 539 augroup vimBarTest |
520 au BufReadCmd * echo 'hello' | 540 au BufReadCmd * echo 'hello' |