mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
@@ -2506,17 +2506,20 @@ endif
|
||||
" Function called for testing all functions defined here. These are
|
||||
" script-local, thus need to be executed here.
|
||||
" Returns a string with error messages (hopefully empty).
|
||||
func! TestFiletypeFuncs(testlist)
|
||||
let output = ''
|
||||
for f in a:testlist
|
||||
try
|
||||
exe f
|
||||
catch
|
||||
let output = output . "\n" . f . ": " . v:exception
|
||||
endtry
|
||||
endfor
|
||||
return output
|
||||
endfunc
|
||||
" Check if function exists first. See https://github.com/vim/vim/issues/9890
|
||||
if !exists("*TestFiletypeFuncs")
|
||||
func! TestFiletypeFuncs(testlist)
|
||||
let output = ''
|
||||
for f in a:testlist
|
||||
try
|
||||
exe f
|
||||
catch
|
||||
let output = output . "\n" . f . ": " . v:exception
|
||||
endtry
|
||||
endfor
|
||||
return output
|
||||
endfunc
|
||||
endif
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
Reference in New Issue
Block a user