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)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index ffeaeca..285d994 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -2579,4 +2579,26 @@
   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
diff --git a/src/testdir/test_preview.vim b/src/testdir/test_preview.vim
index 628ad2b..1bf1d3f 100644
--- a/src/testdir/test_preview.vim
+++ b/src/testdir/test_preview.vim
@@ -25,6 +25,7 @@
   " Go to the preview window
   wincmd P
   call assert_equal(1, &previewwindow)
+  call assert_equal('preview', win_gettype())
 
   " Close preview window
   wincmd z