Fix for scripttest 'test_mapping'/'test_timers' not working in GUI

Make sure to force Vim commands to be launched in terminal mode (-v) if
they are spawned using term_start(). Otherwise they will do the wrong
thing when running GUI tests.
This commit is contained in:
Yee Cheng Chin
2019-07-01 23:36:34 -07:00
parent 8fa50d1832
commit 0cbfb7381e
4 changed files with 11 additions and 5 deletions
+7
View File
@@ -284,6 +284,13 @@ func GetVimCommandClean()
return cmd
endfunc
" Get the command to run Vim, with --clean, and force to run in terminal so it
" won't start a new GUI.
func GetVimCommandCleanTerm()
" Add -v to have gvim run in the terminal (if possible)
return GetVimCommandClean() .. ' -v '
endfunc
" Run Vim, using the "vimcmd" file and "-u NORC".
" "before" is a list of Vim commands to be executed before loading plugins.
" "after" is a list of Vim commands to be executed after loading plugins.
+2 -3
View File
@@ -59,10 +59,9 @@ func RunVimInTerminal(arguments, options)
let cols = get(a:options, 'cols', 75)
let statusoff = get(a:options, 'statusoff', 1)
let cmd = GetVimCommandClean()
let cmd = GetVimCommandCleanTerm()
" Add -v to have gvim run in the terminal (if possible)
let cmd .= ' -v ' . a:arguments
let cmd .= a:arguments
let buf = term_start(cmd, {
\ 'curwin': 1,
\ 'term_rows': rows,
+1 -1
View File
@@ -413,7 +413,7 @@ func Test_error_in_map_expr()
[CODE]
call writefile(lines, 'Xtest.vim')
let buf = term_start(GetVimCommandClean() .. ' -S Xtest.vim', {'term_rows': 8})
let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
let job = term_getjob(buf)
call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))})
+1 -1
View File
@@ -348,7 +348,7 @@ func Test_error_in_timer_callback()
[CODE]
call writefile(lines, 'Xtest.vim')
let buf = term_start(GetVimCommandClean() .. ' -S Xtest.vim', {'term_rows': 8})
let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
let job = term_getjob(buf)
call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))})