annotate src/testdir/test8.in @ 8418:89f38c77e11e v7.4.1500

commit https://github.com/vim/vim/commit/9ef00be261115acb5bae3b3ca45c1d86a19ba2c7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 6 14:58:28 2016 +0100 patch 7.4.1500 Problem: Should_free flag set to FALSE. Solution: Set it to TRUE. (Neovim 4415)
author Christian Brabandt <cb@256bit.org>
date Sun, 06 Mar 2016 15:00:05 +0100
parents 1899acc5aebd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 Test for BufWritePre autocommand that deletes or unloads the buffer.
5233
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
2 Test for BufUnload autocommand that unloads all other buffers.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 STARTTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 :so small.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 :au BufWritePre Xxx1 bunload
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 :au BufWritePre Xxx2 bwipe
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 /^start of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 A1:.,/end of/w! Xxx1 " write test file Xxx1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 $r2:.,/end of/w! Xxx2 " write test file Xxx2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 :e! Xxx2 " edit Xxx2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 :bdel test8.in " delete this file from the buffer list
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 :e Xxx1 " edit Xxx1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 :w " write it, will unload it and give an error msg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 :w! test.out " Write contents of this file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 :e! Xxx2 " start editing Xxx2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 :bwipe test.out " remove test.out from the buffer list
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 :w " write it, will delete the buffer and give an error msg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 :w >>test.out " Append contents of this file
5233
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
20 :au! BufWritePre
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
21 :func CloseAll()
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
22 let i = 0
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
23 while i <= bufnr('$')
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
24 if i != bufnr('%') && bufloaded(i)
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
25 exe i . "bunload"
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
26 endif
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
27 let i += 1
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
28 endwhile
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
29 endfunc
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
30 :func WriteToOut()
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
31 edit! test.out
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
32 $put ='VimLeave done'
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
33 write
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
34 endfunc
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
35 :set viminfo='100,nviminfo
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
36 :au BufUnload * call CloseAll()
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
37 :au VimLeave * call WriteToOut()
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
38 :e small.vim
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
39 :sp mbyte.vim
1899acc5aebd updated for version 7.4a.042
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
40 :q
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 :qa!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 start of Xxx
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 test
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 end of Xxx