mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.1642: running Vim in terminal fails with two windows
Problem: Running Vim in terminal fails with two windows. Solution: Pass the number of rows to RunVimInTerminal().
This commit is contained in:
parent
8fbaeb195d
commit
15a1c3fdc1
@ -47,11 +47,17 @@ func RunVimInTerminal(arguments, options)
|
|||||||
set t_Co=256 background=light
|
set t_Co=256 background=light
|
||||||
hi Normal ctermfg=NONE ctermbg=NONE
|
hi Normal ctermfg=NONE ctermbg=NONE
|
||||||
|
|
||||||
|
" Make the window 20 lines high, unless told otherwise.
|
||||||
|
let rows = 20
|
||||||
|
if has_key(a:options, 'rows')
|
||||||
|
let rows = a:options['rows']
|
||||||
|
endif
|
||||||
|
|
||||||
let cmd = GetVimCommandClean()
|
let cmd = GetVimCommandClean()
|
||||||
" Add -v to have gvim run in the terminal (if possible)
|
" Add -v to have gvim run in the terminal (if possible)
|
||||||
let cmd .= ' -v ' . a:arguments
|
let cmd .= ' -v ' . a:arguments
|
||||||
let buf = term_start(cmd, {'curwin': 1, 'term_rows': 20, 'term_cols': 75})
|
let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': 75})
|
||||||
call assert_equal([20, 75], term_getsize(buf))
|
call assert_equal([rows, 75], term_getsize(buf))
|
||||||
|
|
||||||
return buf
|
return buf
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -1064,7 +1064,7 @@ func Test_terminal_api_drop_oldwin()
|
|||||||
\ 'redraw',
|
\ 'redraw',
|
||||||
\ "set t_ts=",
|
\ "set t_ts=",
|
||||||
\ ], 'Xscript')
|
\ ], 'Xscript')
|
||||||
let buf = RunVimInTerminal('-S Xscript', {})
|
let buf = RunVimInTerminal('-S Xscript', {'rows': 10})
|
||||||
call WaitFor({-> expand('%:t') =='Xtextfile'})
|
call WaitFor({-> expand('%:t') =='Xtextfile'})
|
||||||
call assert_equal(textfile_winid, win_getid())
|
call assert_equal(textfile_winid, win_getid())
|
||||||
|
|
||||||
|
@ -766,6 +766,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1642,
|
||||||
/**/
|
/**/
|
||||||
1641,
|
1641,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user