1Test for autocommand that changes current buffer on BufEnter event.
2Check if modelines are interpreted for the correct buffer.
3
4STARTTEST
5:so small.vim
6:set nocompatible viminfo+=nviminfo
7:au BufEnter Xxx brew
8/start of
9:.,/end of/w! Xxx   " write test file Xxx
10:set ai modeline modelines=3
11:sp Xxx             " split to Xxx, autocmd will do :brew
12G?this is a
13othis should be auto-indented
14:                   " Append text with autoindent to this file
15:au! BufEnter Xxx
16:buf Xxx            " go to Xxx, no autocmd anymore
17G?this is a
18othis should be in column 1:wq " append text without autoindent to Xxx
19G:r Xxx             " include Xxx in the current file
20:?startstart?,$w! test.out
21:qa!
22ENDTEST
23
24startstart
25start of test file Xxx
26vim: set noai :
27	this is a test
28	this is a test
29	this is a test
30	this is a test
31end of test file Xxx
32