1
0
forked from aniani/vim

patch 8.0.1526: no test using a screen dump yet

Problem:    No test using a screen dump yet.
Solution:   Add a test for C syntax highlighting.  Add helper functions.
This commit is contained in:
Bram Moolenaar
2018-02-20 15:51:40 +01:00
parent 7a76092a51
commit da65058a9c
8 changed files with 266 additions and 30 deletions

View File

@@ -178,17 +178,20 @@ endfunc
" The Makefile writes it as the first line in the "vimcmd" file.
func GetVimProg()
if !filereadable('vimcmd')
return ''
" Assume the script was sourced instead of running "make".
return '../vim'
endif
return readfile('vimcmd')[0]
endfunc
" Get the command to run Vim, with -u NONE and --not-a-term arguments.
" If there is an argument use it instead of "NONE".
" Returns an empty string on error.
func GetVimCommand(...)
if !filereadable('vimcmd')
return ''
echo 'Cannot read the "vimcmd" file, falling back to ../vim.'
let lines = ['../vim']
else
let lines = readfile('vimcmd')
endif
if a:0 == 0
let name = 'NONE'
@@ -199,7 +202,6 @@ func GetVimCommand(...)
" "vimcmd" file, including environment options.
" Other Makefiles just write the executable in the first line, so fall back
" to that if there is no second line.
let lines = readfile('vimcmd')
let cmd = get(lines, 1, lines[0])
let cmd = substitute(cmd, '-u \f\+', '-u ' . name, '')
if cmd !~ '-u '. name
@@ -210,6 +212,14 @@ func GetVimCommand(...)
return cmd
endfunc
" Get the command to run Vim, with --clean.
func GetVimCommandClean()
let cmd = GetVimCommand()
let cmd = substitute(cmd, '-u NONE', '--clean', '')
let cmd = substitute(cmd, '--not-a-term', '', '')
return cmd
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.