mirror of
https://github.com/neovim/neovim.git
synced 2026-02-12 15:32:18 +10:00
Vim creates these scripts in test1 depending on what build features are enabled so that tests that use these features are skiped if necessary. Because Neovim only has one type of build (and the features +eval, +windows, and +multi-byte are enabled in this build) they are not necessary.
64 lines
1.5 KiB
Plaintext
64 lines
1.5 KiB
Plaintext
Test for "*Cmd" autocommands
|
||
|
||
STARTTEST
|
||
:set wildchar=^E
|
||
:/^start/,$w! Xxx " write lines below to Xxx
|
||
:au BufReadCmd XtestA 0r Xxx|$del
|
||
:e XtestA " will read text of Xxd instead
|
||
:au BufWriteCmd XtestA call append(line("$"), "write")
|
||
:w " will append a line to the file
|
||
:r XtestA " should not read anything
|
||
: " now we have:
|
||
: " 1 start of Xxx
|
||
: " 2 test40
|
||
: " 3 end of Xxx
|
||
: " 4 write
|
||
:au FileReadCmd XtestB '[r Xxx
|
||
:2r XtestB " will read Xxx below line 2 instead
|
||
: " 1 start of Xxx
|
||
: " 2 test40
|
||
: " 3 start of Xxx
|
||
: " 4 test40
|
||
: " 5 end of Xxx
|
||
: " 6 end of Xxx
|
||
: " 7 write
|
||
:au FileWriteCmd XtestC '[,']copy $
|
||
4GA1
|
||
:4,5w XtestC " will copy lines 4 and 5 to the end
|
||
:r XtestC " should not read anything
|
||
: " 1 start of Xxx
|
||
: " 2 test40
|
||
: " 3 start of Xxx
|
||
: " 4 test401
|
||
: " 5 end of Xxx
|
||
: " 6 end of Xxx
|
||
: " 7 write
|
||
: " 8 test401
|
||
: " 9 end of Xxx
|
||
:au FILEAppendCmd XtestD '[,']w! test.out
|
||
:w >>XtestD " will write all lines to test.out
|
||
:$r XtestD " should not read anything
|
||
:$w >>test.out " append "end of Xxx" to test.out
|
||
:au BufReadCmd XtestE 0r test.out|$del
|
||
:sp XtestE " split window with test.out
|
||
5Goasdf:"
|
||
:au BufWriteCmd XtestE w! test.out
|
||
:wall " will write other window to test.out
|
||
: " 1 start of Xxx
|
||
: " 2 test40
|
||
: " 3 start of Xxx
|
||
: " 4 test401
|
||
: " 5 end of Xxx
|
||
: " 6 asdf
|
||
: " 7 end of Xxx
|
||
: " 8 write
|
||
: " 9 test401
|
||
: " 10 end of Xxx
|
||
: " 11 end of Xxx
|
||
:qa!
|
||
ENDTEST
|
||
|
||
start of Xxx
|
||
test40
|
||
end of Xxx
|