diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-05-05 07:26:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-05 07:26:42 +0800 |
| commit | 82c7a82c3585100e73e154c49e3e002b7dc35437 (patch) | |
| tree | aa7a3591f116b6ad6752b689aab20bb87b5f4cbc /src/nvim/testdir/test_help.vim | |
| parent | beb8f484891f5361cc2ee757b93b4e4aba228612 (diff) | |
| download | rneovim-82c7a82c3585100e73e154c49e3e002b7dc35437.tar.gz rneovim-82c7a82c3585100e73e154c49e3e002b7dc35437.tar.bz2 rneovim-82c7a82c3585100e73e154c49e3e002b7dc35437.zip | |
vim-patch:8.2.4868: when closing help window autocmds triggered for wrong window (#18420)
Problem: When closing help window autocmds triggered for the wrong window.
Solution: Figure out the new current window earlier. (closes vim/vim#10348)
https://github.com/vim/vim/commit/2a2707d03337d0bb7d5fd1770238809618653d4a
Diffstat (limited to 'src/nvim/testdir/test_help.vim')
| -rw-r--r-- | src/nvim/testdir/test_help.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_help.vim b/src/nvim/testdir/test_help.vim index b2d943be00..9569cfa4e5 100644 --- a/src/nvim/testdir/test_help.vim +++ b/src/nvim/testdir/test_help.vim @@ -9,6 +9,30 @@ func Test_help_restore_snapshot() helpclose endfunc +func Test_help_restore_snapshot_split() + " Squeeze the unnamed buffer, Xfoo and the help one side-by-side and focus + " the first one before calling :help. + let bnr = bufnr() + botright vsp Xfoo + wincmd h + help + wincmd L + let g:did_bufenter = v:false + augroup T + au! + au BufEnter Xfoo let g:did_bufenter = v:true + augroup END + helpclose + augroup! T + " We're back to the unnamed buffer. + call assert_equal(bnr, bufnr()) + " No BufEnter was triggered for Xfoo. + call assert_equal(v:false, g:did_bufenter) + + close! + bwipe! +endfunc + func Test_help_errors() call assert_fails('help doesnotexist', 'E149:') call assert_fails('help!', 'E478:') |