Skip to content

Commit 15a1c3f

Browse files
committed
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().
1 parent 8fbaeb1 commit 15a1c3f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/testdir/screendump.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ func RunVimInTerminal(arguments, options)
4747
set t_Co=256 background=light
4848
hi Normal ctermfg=NONE ctermbg=NONE
4949

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
55+
5056
let cmd = GetVimCommandClean()
5157
" Add -v to have gvim run in the terminal (if possible)
5258
let cmd .= ' -v ' . a:arguments
53-
let buf = term_start(cmd, {'curwin': 1, 'term_rows': 20, 'term_cols': 75})
54-
call assert_equal([20, 75], term_getsize(buf))
59+
let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': 75})
60+
call assert_equal([rows, 75], term_getsize(buf))
5561

5662
return buf
5763
endfunc

src/testdir/test_terminal.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ func Test_terminal_api_drop_oldwin()
10641064
\ 'redraw',
10651065
\ "set t_ts=",
10661066
\ ], 'Xscript')
1067-
let buf = RunVimInTerminal('-S Xscript', {})
1067+
let buf = RunVimInTerminal('-S Xscript', {'rows': 10})
10681068
call WaitFor({-> expand('%:t') =='Xtextfile'})
10691069
call assert_equal(textfile_winid, win_getid())
10701070

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static char *(features[]) =
766766

767767
static int included_patches[] =
768768
{ /* Add new patch number below this line */
769+
/**/
770+
1642,
769771
/**/
770772
1641,
771773
/**/

0 commit comments

Comments
 (0)