comparison src/testdir/test_window_cmd.vim @ 19932:2c4d9ca33769 v8.2.0522

patch 8.2.0522: several errors are not tested for Commit: https://github.com/vim/vim/commit/ee4e0c1e9a81cb5d96e0060203a9033c2f28588e Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 6 21:35:05 2020 +0200 patch 8.2.0522: several errors are not tested for Problem: Several errors are not tested for. Solution: Add tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5892)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Apr 2020 21:45:31 +0200
parents 546bdeef35f1
children 16460964c304
comparison
equal deleted inserted replaced
19931:db6b095f4073 19932:2c4d9ca33769
199 let ver_split_count = ver_win_count - 1 199 let ver_split_count = ver_win_count - 1
200 for s in range(1, ver_split_count) | vsplit | endfor 200 for s in range(1, ver_split_count) | vsplit | endfor
201 call assert_fails('vsplit', 'E36:') 201 call assert_fails('vsplit', 'E36:')
202 202
203 %bw! 203 %bw!
204 endfunc
205
206 func Test_window_preview()
207 CheckFeature quickfix
208
209 " Open a preview window
210 pedit Xa
211 call assert_equal(2, winnr('$'))
212 call assert_equal(0, &previewwindow)
213
214 " Go to the preview window
215 wincmd P
216 call assert_equal(1, &previewwindow)
217
218 " Close preview window
219 wincmd z
220 call assert_equal(1, winnr('$'))
221 call assert_equal(0, &previewwindow)
222
223 call assert_fails('wincmd P', 'E441:')
224 endfunc
225
226 func Test_window_preview_from_help()
227 CheckFeature quickfix
228
229 filetype on
230 call writefile(['/* some C code */'], 'Xpreview.c')
231 help
232 pedit Xpreview.c
233 wincmd P
234 call assert_equal(1, &previewwindow)
235 call assert_equal('c', &filetype)
236 wincmd z
237
238 filetype off
239 close
240 call delete('Xpreview.c')
241 endfunc 204 endfunc
242 205
243 func Test_window_exchange() 206 func Test_window_exchange()
244 e Xa 207 e Xa
245 208