better error messages

This commit is contained in:
Chiel92 2013-03-09 19:41:31 +01:00
parent 2623f9b650
commit 5b547a33dd
2 changed files with 8 additions and 2 deletions

View File

@ -93,3 +93,4 @@ This means that customization of formatprograms can be done easily now, as expla
* I set the default tabwidth to 4 for all formatprograms as well as for vim itself.
* The default parameters for astyle have been slightly modified: it will wrap spaces around operators.
* phpCB has been removed from the defaults, due to buggy behaviour.
* XHTML support added

View File

@ -9,7 +9,12 @@ function! s:Autoformat()
"Recall window state
call winrestview(winview)
else
echo "No formatter defined for filetype ".&filetype
let s:formatprg_var = "g:formatprg_".&filetype
if !exists(s:formatprg_var)
echo "No formatter defined for filetype ".&filetype
else
echo "Defined formatter ".eval(s:formatprg_var)." is not executable"
endif
endif
endfunction
@ -28,7 +33,7 @@ function! s:set_formatprg()
let s:formatprg_var = "g:formatprg_".&filetype
let s:formatprg_args_var = "g:formatprg_args_".&filetype
if !exists(s:formatprg_var) || !exists(s:formatprg_args_var)
"No formatprg configured
"No formatprg defined
return
endif
let s:formatprg = eval(s:formatprg_var)