@@ -24,7 +24,9 @@ source shared.vim
2424" By default uses a size of 20 lines and 75 columns.
2525" Returns the buffer number of the terminal.
2626"
27- " Options is a dictionary (not used yet).
27+ " Options is a dictionary, these items are recognized:
28+ " "rows" - height of the terminal window (max. 20)
29+ " "cols" - width of the terminal window (max. 78)
2830func RunVimInTerminal (arguments, options )
2931 " If Vim doesn't exit a swap file remains, causing other tests to fail.
3032 " Remove it here.
@@ -47,17 +49,15 @@ func RunVimInTerminal(arguments, options)
4749 set t_Co = 256 background = light
4850 hi Normal ctermfg= NONE ctermbg= NONE
4951
50- " Make the window 20 lines high, unless told otherwise.
51- let rows = 20
52- if has_key (a: options , ' rows' )
53- let rows = a: options [' rows' ]
54- endif
52+ " Make the window 20 lines high and 75 columns, unless told otherwise.
53+ let rows = get (a: options , ' rows' , 20 )
54+ let cols = get (a: options , ' cols' , 75 )
5555
5656 let cmd = GetVimCommandClean ()
5757 " Add -v to have gvim run in the terminal (if possible)
5858 let cmd .= ' -v ' . a: arguments
59- let buf = term_start (cmd, {' curwin' : 1 , ' term_rows' : rows, ' term_cols' : 75 })
60- call assert_equal ([rows, 75 ], term_getsize (buf ))
59+ let buf = term_start (cmd, {' curwin' : 1 , ' term_rows' : rows, ' term_cols' : cols })
60+ call assert_equal ([rows, cols ], term_getsize (buf ))
6161
6262 return buf
6363endfunc
0 commit comments