Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | Test for autocommand that changes current buffer on BufEnter event. |
| 2 | Check if modelines are interpreted for the correct buffer. |
| 3 | |
| 4 | STARTTEST |
| 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 |
| 12 | G?this is a |
| 13 | othis 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 |
| 17 | G?this is a |
| 18 | othis should be in column 1:wq " append text without autoindent to Xxx |
| 19 | G:r Xxx " include Xxx in the current file |
Bram Moolenaar | 2f31e39 | 2014-10-31 19:20:36 +0100 | [diff] [blame] | 20 | :set fo+=r " issue #57 do not move cursor on <c-o> when autoindent is set |
| 21 | Go# abcdef2hi |
Bram Moolenaar | 901e58c | 2015-08-11 18:33:48 +0200 | [diff] [blame] | 22 | d0o# abcdef2hid0: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | :?startstart?,$w! test.out |
| 24 | :qa! |
| 25 | ENDTEST |
| 26 | |
| 27 | startstart |
| 28 | start of test file Xxx |
| 29 | vim: set noai : |
| 30 | this is a test |
| 31 | this is a test |
| 32 | this is a test |
| 33 | this is a test |
| 34 | end of test file Xxx |