Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | Test for autocommand that deletes the current buffer on BufLeave event. |
| 2 | Also test deleting the last buffer, should give a new, empty buffer. |
| 3 | |
| 4 | STARTTEST |
| 5 | :so small.vim |
| 6 | :au BufLeave Xxx bwipe |
| 7 | /start of |
| 8 | :.,/end of/w! Xxx " write test file Xxx |
| 9 | :sp Xxx " split to Xxx |
| 10 | :bwipe " delete buffer Xxx, now we're back here |
| 11 | G?this is a |
| 12 | othis is some more text |
| 13 | : " Append some text to this file |
| 14 | :?start?,$w! test.out " Write current file contents |
| 15 | :bwipe test.out " delete alternate buffer |
| 16 | :au bufleave test5.in bwipe |
| 17 | :bwipe! " delete current buffer, get an empty one |
| 18 | ithis is another test line:w >>test.out |
| 19 | : " append an extra line to the output file |
| 20 | :qa! |
| 21 | ENDTEST |
| 22 | |
| 23 | start of test file Xxx |
| 24 | vim: set noai : |
| 25 | this is a test |
| 26 | this is a test |
| 27 | this is a test |
| 28 | this is a test |
| 29 | end of test file Xxx |