summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2022-04-18 12:08:03 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2022-04-18 12:08:03 +0200
commitaae85fe8c2a5878aee89ff8025306f3142962b5f (patch)
tree0cd2cb4931c73ceccd5e11bf27f53ab55efd19bc /extras
parenta4f98d2a9e9dfeb110d4a910ea177432fec88b81 (diff)
parent55eed00f71914e21c804cc0b8f271b04f4e11c2b (diff)
downloadvim-polyglot-aae85fe8c2a5878aee89ff8025306f3142962b5f.tar.gz
vim-polyglot-aae85fe8c2a5878aee89ff8025306f3142962b5f.zip
Merge branch 'master' of https://github.com/sheerun/vim-polyglot
Diffstat (limited to 'extras')
-rw-r--r--extras/filetype.vim25
1 files changed, 14 insertions, 11 deletions
diff --git a/extras/filetype.vim b/extras/filetype.vim
index f6cb13a1..391c2d49 100644
--- a/extras/filetype.vim
+++ b/extras/filetype.vim
@@ -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