Skip to content

Commit

Permalink
patch 8.0.1642: running Vim in terminal fails with two windows
Browse files Browse the repository at this point in the history
Problem:    Running Vim in terminal fails with two windows.
Solution:   Pass the number of rows to RunVimInTerminal().
  • Loading branch information
brammool committed Mar 25, 2018
1 parent 8fbaeb1 commit 15a1c3f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/testdir/screendump.vim
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ func RunVimInTerminal(arguments, options)
set t_Co=256 background=light
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()
" Add -v to have gvim run in the terminal (if possible)
let cmd .= ' -v ' . a:arguments
let buf = term_start(cmd, {'curwin': 1, 'term_rows': 20, 'term_cols': 75})
call assert_equal([20, 75], term_getsize(buf))
let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': 75})
call assert_equal([rows, 75], term_getsize(buf))

return buf
endfunc
Expand Down
2 changes: 1 addition & 1 deletion src/testdir/test_terminal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ func Test_terminal_api_drop_oldwin()
\ 'redraw',
\ "set t_ts=",
\ ], 'Xscript')
let buf = RunVimInTerminal('-S Xscript', {})
let buf = RunVimInTerminal('-S Xscript', {'rows': 10})
call WaitFor({-> expand('%:t') =='Xtextfile'})
call assert_equal(textfile_winid, win_getid())

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1642,
/**/
1641,
/**/
Expand Down

0 comments on commit 15a1c3f

Please sign in to comment.