annotate src/testdir/test_winbuf_close.vim @ 18078:5ae41d0ea397 v8.1.2034

patch 8.1.2034: dark them of GTK 3 not supported Commit: https://github.com/vim/vim/commit/50bf7ce0c9f8c3ede2d1a02c734beba9d5a0504e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 15 13:17:00 2019 +0200 patch 8.1.2034: dark them of GTK 3 not supported Problem: Dark them of GTK 3 not supported. Solution: Add the "d" flag in 'guioptions'. (Jonathan Conder, closes https://github.com/vim/vim/issues/4934)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Sep 2019 13:30:04 +0200
parents a3284dd27de6
children 013f20a3bc6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12616
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for commands that close windows and/or buffers:
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " :quit
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " :close
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " :hide
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " :only
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " :sall
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " :all
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 " :ball
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 " :buf
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 " :edit
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 "
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 func Test_winbuf_close()
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 enew | only
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 call writefile(['testtext 1'], 'Xtest1')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call writefile(['testtext 2'], 'Xtest2')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call writefile(['testtext 3'], 'Xtest3')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 next! Xtest1 Xtest2
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call setline(1, 'testtext 1 1')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " test for working :n when hidden set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 set hidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 next
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call assert_equal('Xtest2', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 " test for failing :rew when hidden not set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 set nohidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call setline(1, 'testtext 2 2')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_fails('rewind', 'E37')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call assert_equal('Xtest2', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call assert_equal('testtext 2 2', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 " test for working :rew when hidden set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 set hidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 rewind
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 call assert_equal('Xtest1', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call assert_equal('testtext 1 1', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 " test for :all keeping a buffer when it's modified
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 set nohidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 call setline(1, 'testtext 1 1 1')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 split
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 next Xtest2 Xtest3
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 all
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 1wincmd w
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 call assert_equal('Xtest1', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 call assert_equal('testtext 1 1 1', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 " test abandoning changed buffer, should be unloaded even when 'hidden' set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 set hidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call setline(1, 'testtext 1 1 1 1')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 quit!
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call assert_equal('Xtest2', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call assert_equal('testtext 2 2', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 unhide
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 call assert_equal('Xtest2', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 call assert_equal('testtext 2 2', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 " test ":hide" hides anyway when 'hidden' not set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 set nohidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 call setline(1, 'testtext 2 2 2')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 hide
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 call assert_equal('Xtest3', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 call assert_equal('testtext 3', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 " test ":edit" failing in modified buffer when 'hidden' not set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 call setline(1, 'testtext 3 3')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 call assert_fails('edit Xtest1', 'E37')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 call assert_equal('Xtest3', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 call assert_equal('testtext 3 3', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 " test ":edit" working in modified buffer when 'hidden' set
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 set hidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 edit Xtest1
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 call assert_equal('Xtest1', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 call assert_equal('testtext 1', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 " test ":close" not hiding when 'hidden' not set in modified buffer
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 split Xtest3
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 set nohidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 call setline(1, 'testtext 3 3 3')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 call assert_fails('close', 'E37')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 call assert_equal('Xtest3', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 call assert_equal('testtext 3 3 3', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 " test ":close!" does hide when 'hidden' not set in modified buffer;
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 call setline(1, 'testtext 3 3 3 3')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 close!
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 call assert_equal('Xtest1', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 call assert_equal('testtext 1', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 set nohidden
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 " test ":all!" hides changed buffer
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 split Xtest4
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 call setline(1, 'testtext 4')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 all!
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 1wincmd w
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 call assert_equal('Xtest2', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 call assert_equal('testtext 2 2 2', getline(1))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 " test ":q!" and hidden buffer.
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 bwipe! Xtest1 Xtest2 Xtest3 Xtest4
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 split Xtest1
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 wincmd w
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 bwipe!
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 set modified
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 bot split Xtest2
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 set modified
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111 bot split Xtest3
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 set modified
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113 wincmd t
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 hide
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 call assert_equal('Xtest2', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 quit!
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117 call assert_equal('Xtest3', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 call assert_fails('silent! quit!', 'E162')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119 call assert_equal('Xtest1', bufname('%'))
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 call delete('Xtest1')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 call delete('Xtest2')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 call delete('Xtest3')
4767939d10cc patch 8.0.1186: still quite a few old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 endfunc
13837
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
125
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
126 " Test that ":close" will respect 'winfixheight' when possible.
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
127 func Test_winfixheight_on_close()
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
128 set nosplitbelow nosplitright
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
129
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
130 split | split | vsplit
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
131
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
132 $wincmd w
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
133 setlocal winfixheight
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
134 let l:height = winheight(0)
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
135
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
136 3close
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
137
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
138 call assert_equal(l:height, winheight(0))
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
139
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
140 %bwipeout!
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
141 setlocal nowinfixheight splitbelow& splitright&
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
142 endfunc
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
143
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
144 " Test that ":close" will respect 'winfixwidth' when possible.
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
145 func Test_winfixwidth_on_close()
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
146 set nosplitbelow nosplitright
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
147
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
148 vsplit | vsplit | split
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
149
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
150 $wincmd w
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
151 setlocal winfixwidth
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
152 let l:width = winwidth(0)
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
153
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
154 3close
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
155
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
156 call assert_equal(l:width, winwidth(0))
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
157
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
158 %bwipeout!
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
159 setlocal nowinfixwidth splitbelow& splitright&
79419af4b29c patch 8.0.1790: 'winfixwidth' is not always respected by :close
Christian Brabandt <cb@256bit.org>
parents: 12616
diff changeset
160 endfunction
16166
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
161
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
162 " Test that 'winfixheight' will be respected even there is non-leaf frame
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
163 fun! Test_winfixheight_non_leaf_frame()
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
164 vsplit
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
165 botright 11new
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
166 let l:wid = win_getid()
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
167 setlocal winfixheight
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
168 call assert_equal(11, winheight(l:wid))
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
169 botright new
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
170 bwipe!
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
171 call assert_equal(11, winheight(l:wid))
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
172 %bwipe!
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
173 endf
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
174
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
175 " Test that 'winfixwidth' will be respected even there is non-leaf frame
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
176 fun! Test_winfixwidth_non_leaf_frame()
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
177 split
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
178 topleft 11vnew
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
179 let l:wid = win_getid()
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
180 setlocal winfixwidth
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
181 call assert_equal(11, winwidth(l:wid))
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
182 topleft new
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
183 bwipe!
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
184 call assert_equal(11, winwidth(l:wid))
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
185 %bwipe!
a3284dd27de6 patch 8.1.1088: height of quickfix window not retained with vertical split
Bram Moolenaar <Bram@vim.org>
parents: 13837
diff changeset
186 endf