0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.0991: cannot get window type for autocmd and preview window

Problem:    Cannot get window type for autocmd and preview window.
Solution:   Add types to win_gettype(). (Yegappan Lakshmanan, closes #6277)
This commit is contained in:
Bram Moolenaar
2020-06-16 22:42:04 +02:00
parent a1bc6f1293
commit 0fe937fd86
5 changed files with 36 additions and 3 deletions

View File

@@ -2579,4 +2579,26 @@ func Test_BufDelete_changebuf()
close!
endfunc
" Test for the temporary internal window used to execute autocmds
func Test_autocmd_window()
%bw!
edit one.txt
tabnew two.txt
let g:blist = []
augroup aucmd_win_test
au!
au BufEnter * call add(g:blist, [expand('<afile>'),
\ win_gettype(bufwinnr(expand('<afile>')))])
augroup END
doautoall BufEnter
call assert_equal([['one.txt', 'aucmdwin'], ['two.txt', '']], g:blist)
augroup aucmd_win_test
au!
augroup END
augroup! aucmd_win_test
%bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -25,6 +25,7 @@ func Test_window_preview()
" Go to the preview window
wincmd P
call assert_equal(1, &previewwindow)
call assert_equal('preview', win_gettype())
" Close preview window
wincmd z