From 04031093dd873153b8af734fae5122bf27dcdb19 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 3 Nov 2017 22:47:59 +1300 Subject: Check for availability of Vim shellescape() It doesn't seem to be in very old Vims; worth testing for to avoid errors if I try to use the function. --- vim/ftplugin/html.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vim/ftplugin/html.vim') diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim index 7400326c..5505dbaa 100644 --- a/vim/ftplugin/html.vim +++ b/vim/ftplugin/html.vim @@ -1,8 +1,10 @@ " Run tidy -eq -utf8 on file for the current buffer -function s:HTMLTidy() - execute '!tidy -eq -utf8 ' . shellescape(expand('%')) -endfunction -nnoremap v :exe :call HTMLTidy() +if exists('*shellescape') + function s:HTMLTidy() + execute '!tidy -eq -utf8 ' . shellescape(expand('%')) + endfunction + nnoremap v :exe :call HTMLTidy() +endif " Make a bare URL into a link to itself function! s:UrlLink() -- cgit v1.2.3