comparison src/testdir/test_help.vim @ 28688:264fa41e6704 v8.2.4868

patch 8.2.4868: when closing help window autocmds triggered for wrong window Commit: https://github.com/vim/vim/commit/2a2707d03337d0bb7d5fd1770238809618653d4a Author: LemonBoy <thatlemon@gmail.com> Date: Wed May 4 22:13:47 2022 +0100 patch 8.2.4868: when closing help window autocmds triggered for wrong window Problem: When closing help window autocmds triggered for the wrong window. Solution: Figure out the new current window earlier. (closes https://github.com/vim/vim/issues/10348)
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 May 2022 23:15:02 +0200
parents 6ba17bf0f86a
children af4ffc4b2a26
comparison
equal deleted inserted replaced
28687:b7aa8a9e166a 28688:264fa41e6704
8 set buftype= 8 set buftype=
9 help 9 help
10 edit x 10 edit x
11 help 11 help
12 helpclose 12 helpclose
13 endfunc
14
15 func Test_help_restore_snapshot_split()
16 " Squeeze the unnamed buffer, Xfoo and the help one side-by-side and focus
17 " the first one before calling :help.
18 let bnr = bufnr()
19 botright vsp Xfoo
20 wincmd h
21 help
22 wincmd L
23 let g:did_bufenter = v:false
24 augroup T
25 au!
26 au BufEnter Xfoo let g:did_bufenter = v:true
27 augroup END
28 helpclose
29 augroup! T
30 " We're back to the unnamed buffer.
31 call assert_equal(bnr, bufnr())
32 " No BufEnter was triggered for Xfoo.
33 call assert_equal(v:false, g:did_bufenter)
34
35 close!
36 bwipe!
13 endfunc 37 endfunc
14 38
15 func Test_help_errors() 39 func Test_help_errors()
16 call assert_fails('help doesnotexist', 'E149:') 40 call assert_fails('help doesnotexist', 'E149:')
17 call assert_fails('help!', 'E478:') 41 call assert_fails('help!', 'E478:')