blob: b8bd9fc9cf87cca0138f61e601ffedf63cccbb49 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001Test 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
Bram Moolenaar2f31e392014-10-31 19:20:36 +010020:set fo+=r " issue #57 do not move cursor on <c-o> when autoindent is set
21Go# abcdef2hi
22d0o# abcdef2hid0
Bram Moolenaar071d4272004-06-13 20:20:40 +000023:?startstart?,$w! test.out
24:qa!
25ENDTEST
26
27startstart
28start of test file Xxx
29vim: set noai :
30 this is a test
31 this is a test
32 this is a test
33 this is a test
34end of test file Xxx