7
|
1 Test for commands that close windows and/or buffers:
|
|
2 :quit
|
|
3 :close
|
|
4 :hide
|
|
5 :only
|
|
6 :sall
|
|
7 :all
|
|
8 :ball
|
|
9 :buf
|
|
10 :edit
|
|
11
|
|
12 STARTTEST
|
|
13 :so tiny.vim
|
|
14 GA 1:$w! Xtest1
|
|
15 $r2:$w! Xtest2
|
|
16 $r3:$w! Xtest3
|
|
17 :n! Xtest1 Xtest2
|
|
18 A 1:set hidden
|
|
19 :" test for working :n when hidden set; write "testtext 2"
|
|
20 :n
|
|
21 :w! test.out
|
|
22 :" test for failing :rew when hidden not set; write "testtext 2 2"
|
|
23 :set nohidden
|
|
24 A 2:rew
|
|
25 :w >>test.out
|
|
26 :" test for working :rew when hidden set; write "testtext 1 1"
|
|
27 :set hidden
|
|
28 :rew
|
|
29 :w >>test.out
|
|
30 :" test for :all keeping a buffer when it's modified; write "testtext 1 1 1"
|
|
31 :set nohidden
|
|
32 A 1:sp
|
|
33 :n Xtest2 Xtest3
|
|
34 :all
|
730
|
35 :1wincmd w
|
7
|
36 :w >>test.out
|
|
37 :" test abandoning changed buffer, should be unloaded even when 'hidden' set
|
|
38 :" write "testtext 2 2" twice
|
|
39 :set hidden
|
|
40 A 1:q!
|
|
41 :w >>test.out
|
|
42 :unhide
|
|
43 :w >>test.out
|
|
44 :" test ":hide" hides anyway when 'hidden' not set; write "testtext 3"
|
|
45 :set nohidden
|
|
46 A 2:hide
|
|
47 :w >>test.out
|
|
48 :" test ":edit" failing in modified buffer when 'hidden' not set
|
|
49 :" write "testtext 3 3"
|
|
50 A 3:e Xtest1
|
|
51 :w >>test.out
|
|
52 :" test ":edit" working in modified buffer when 'hidden' set; write "testtext 1"
|
|
53 :set hidden
|
|
54 :e Xtest1
|
|
55 :w >>test.out
|
|
56 :" test ":close" not hiding when 'hidden' not set in modified buffer;
|
|
57 :" write "testtext 3 3 3"
|
|
58 :sp Xtest3
|
|
59 :set nohidden
|
|
60 A 3:close
|
|
61 :w >>test.out
|
|
62 :" test ":close!" does hide when 'hidden' not set in modified buffer;
|
|
63 :" write "testtext 1"
|
|
64 A 3:close!
|
|
65 :w >>test.out
|
3354
|
66 :set nohidden
|
|
67 :" test ":all!" hides changed buffer; write "testtext 2 2 2"
|
|
68 :sp Xtest4
|
|
69 GA 4:all!
|
|
70 :1wincmd w
|
|
71 :w >>test.out
|
7
|
72 :qa!
|
|
73 ENDTEST
|
|
74
|
|
75 testtext
|