]> granicus.if.org Git - vim/commitdiff
patch 8.0.1642: running Vim in terminal fails with two windows v8.0.1642
authorBram Moolenaar <Bram@vim.org>
Sun, 25 Mar 2018 16:56:25 +0000 (18:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 25 Mar 2018 16:56:25 +0000 (18:56 +0200)
Problem:    Running Vim in terminal fails with two windows.
Solution:   Pass the number of rows to RunVimInTerminal().

src/testdir/screendump.vim
src/testdir/test_terminal.vim
src/version.c

index 093b483f10dcf44cabb1a1db99f7223d2b6b7bc2..60c0ccb0128a959546a4bc54d1cd10db1b24e01b 100644 (file)
@@ -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
index a7e5f616831b7fe96e6d52f908652d3109f276a5..6f655185f3b6297025d6a97939e2fd8413ba6add 100644 (file)
@@ -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())
 
index 3295eb0892ced756443c59a1ba56ce4397f471de..c648d52c3f7735d25b04edf155d29268e9aa0211 100644 (file)
@@ -766,6 +766,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1642,
 /**/
     1641,
 /**/