comparison src/testdir/test_window_cmd.vim @ 19740:a653d1a165ef v8.2.0426

patch 8.2.0426: some errors were not tested for Commit: https://github.com/vim/vim/commit/9b9be007e7d674f49fc2b650f840d08532b180ad Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 22 14:41:22 2020 +0100 patch 8.2.0426: some errors were not tested for Problem: Some errors were not tested for. Solution: Add tests. (Dominique Pelle, closes https://github.com/vim/vim/issues/5824)
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Mar 2020 14:45:04 +0100
parents b3e93a05c3ca
children d089bd9511c0
comparison
equal deleted inserted replaced
19739:c49354aed1b2 19740:a653d1a165ef
168 168
169 execute l:baz_nr . 'wincmd ^' 169 execute l:baz_nr . 'wincmd ^'
170 call assert_equal('Xbaz', bufname(winbufnr(1))) 170 call assert_equal('Xbaz', bufname(winbufnr(1)))
171 call assert_equal('Xbar', bufname(winbufnr(2))) 171 call assert_equal('Xbar', bufname(winbufnr(2)))
172 endif 172 endif
173
174 %bw!
175 endfunc
176
177 func Test_window_split_no_room()
178 " N horizontal windows need >= 2*N + 1 lines:
179 " - 1 line + 1 status line in each window
180 " - 1 Ex command line
181 "
182 " 2*N + 1 <= &lines
183 " N <= (lines - 1)/2
184 "
185 " Beyond that number of windows, E36: Not enough room is expected.
186 let hor_win_count = (&lines - 1)/2
187 let hor_split_count = hor_win_count - 1
188 for s in range(1, hor_split_count) | split | endfor
189 call assert_fails('split', 'E36:')
190
191 " N vertical windows need >= 2*(N - 1) + 1 columns:
192 " - 1 column + 1 separator for each window (except last window)
193 " - 1 column for the last window which does not have separator
194 "
195 " 2*(N - 1) + 1 <= &columns
196 " 2*N - 1 <= &columns
197 " N <= (&columns + 1)/2
198 let ver_win_count = (&columns + 1)/2
199 let ver_split_count = ver_win_count - 1
200 for s in range(1, ver_split_count) | vsplit | endfor
201 call assert_fails('vsplit', 'E36:')
173 202
174 %bw! 203 %bw!
175 endfunc 204 endfunc
176 205
177 func Test_window_preview() 206 func Test_window_preview()