mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
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:
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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))})
|
||||
|
||||
|
||||
@@ -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))})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user