comparison src/testdir/test_terminal.vim @ 12060:a879814b8a37 v8.0.0910

patch 8.0.0910: cannot create a terminal in the current window commit https://github.com/vim/vim/commit/da43b61dddcf81439a6f1716956a4e8d9046e68f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 11 22:27:50 2017 +0200 patch 8.0.0910: cannot create a terminal in the current window Problem: Cannot create a terminal in the current window. Solution: Add option "curwin" and ++curwin.
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2017 22:30:06 +0200
parents 0498547dace0
children 191ccece2f5d
comparison
equal deleted inserted replaced
12059:4ee89f4c6b25 12060:a879814b8a37
281 281
282 call term_start(cmd, {'vertical': 1, 'term_rows': 7, 'term_cols': 27}) 282 call term_start(cmd, {'vertical': 1, 'term_rows': 7, 'term_cols': 27})
283 let size = term_getsize('') 283 let size = term_getsize('')
284 bwipe! 284 bwipe!
285 call assert_equal([7, 27], size) 285 call assert_equal([7, 27], size)
286 endfunc
287
288 func Test_terminal_curwin()
289 let cmd = Get_cat_123_cmd()
290 call assert_equal(1, winnr('$'))
291
292 split dummy
293 exe 'terminal ++curwin ' . cmd
294 call assert_equal(2, winnr('$'))
295 bwipe!
296
297 split dummy
298 call term_start(cmd, {'curwin': 1})
299 call assert_equal(2, winnr('$'))
300 bwipe!
301
302 split dummy
303 call setline(1, 'change')
304 call assert_fails('terminal ++curwin ' . cmd, 'E37:')
305 call assert_equal(2, winnr('$'))
306 exe 'terminal! ++curwin ' . cmd
307 call assert_equal(2, winnr('$'))
308 bwipe!
309
310 split dummy
311 call setline(1, 'change')
312 call assert_fails("call term_start(cmd, {'curwin': 1})", 'E37:')
313 call assert_equal(2, winnr('$'))
314 bwipe!
315
316 split dummy
317 bwipe!
286 318
287 endfunc 319 endfunc
288 320
289 func Test_finish_close() 321 func Test_finish_close()
290 " TODO: use something that takes much less than a whole second 322 " TODO: use something that takes much less than a whole second