summaryrefslogtreecommitdiff
path: root/src/testdir/test31.in
blob: b00c7602ef0b4bf7707b23ff3a7c687e0b20225a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Test for commands that close windows and/or buffers:
:quit
:close
:hide
:only
:sall
:all
:ball
:buf
:edit

STARTTEST
:so tiny.vim
GA 1:$w! Xtest1
$r2:$w! Xtest2
$r3:$w! Xtest3
:n! Xtest1 Xtest2
A 1:set hidden
:" test for working :n when hidden set; write "testtext 2"
:n
:w! test.out
:" test for failing :rew when hidden not set; write "testtext 2 2"
:set nohidden
A 2:rew
:w >>test.out
:" test for working :rew when hidden set; write "testtext 1 1"
:set hidden
:rew
:w >>test.out
:" test for :all keeping a buffer when it's modified; write "testtext 1 1 1"
:set nohidden
A 1:sp
:n Xtest2 Xtest3
:all
:1wincmd w
:w >>test.out
:" test abandoning changed buffer, should be unloaded even when 'hidden' set
:" write "testtext 2 2" twice
:set hidden
A 1:q!
:w >>test.out
:unhide
:w >>test.out
:" test ":hide" hides anyway when 'hidden' not set; write "testtext 3"
:set nohidden
A 2:hide
:w >>test.out
:" test ":edit" failing in modified buffer when 'hidden' not set
:" write "testtext 3 3"
A 3:e Xtest1
:w >>test.out
:" test ":edit" working in modified buffer when 'hidden' set; write "testtext 1"
:set hidden
:e Xtest1
:w >>test.out
:" test ":close" not hiding when 'hidden' not set in modified buffer;
:" write "testtext 3 3 3"
:sp Xtest3
:set nohidden
A 3:close
:w >>test.out
:" test ":close!" does hide when 'hidden' not set in modified buffer;
:" write "testtext 1"
A 3:close!
:w >>test.out
:qa!
ENDTEST

testtext