minor changes & formatting changes

This commit is contained in:
Steve Dignam 2016-02-10 22:49:16 -05:00
parent 11023a0f27
commit cb4f717fbe
2 changed files with 16 additions and 11 deletions

View File

@ -13,7 +13,7 @@ function! s:find_formatters(...)
let ftype = a:0 ? a:1 : &filetype let ftype = a:0 ? a:1 : &filetype
" Support composite filetypes by replacing dots with underscores " Support composite filetypes by replacing dots with underscores
let compoundtype = substitute(ftype, "[.]", "_", "g") let compoundtype = substitute(ftype, "[.]", "_", "g")
if ftype =~ "[.]" if ftype =~? "[.]"
" Try all super filetypes in search for formatters in a sane order " Try all super filetypes in search for formatters in a sane order
let ftypes = [compoundtype] + split(ftype, "[.]") let ftypes = [compoundtype] + split(ftype, "[.]")
else else
@ -37,11 +37,11 @@ function! s:find_formatters(...)
if !exists(formatters_var) if !exists(formatters_var)
" No formatters defined " No formatters defined
if verbose if verbose
echoerr "No formatters defined for supertype '".supertype echoerr "No formatters defined for supertype ".supertype
endif endif
else else
let formatters = eval(formatters_var) let formatters = eval(formatters_var)
if type(formatters) != 3 if type(formatters) != type([])
echoerr formatter_var." is not a list" echoerr formatter_var." is not a list"
else else
let b:formatters = b:formatters + formatters let b:formatters = b:formatters + formatters

View File

@ -230,17 +230,22 @@ endif
" Perl " Perl
if !exists('g:formatdef_perltidy') if !exists('g:formatdef_perltidy')
" use perltidyrc file if readable " use perltidyrc file if readable
if (has("win32") && (filereadable("perltidy.ini") || filereadable($HOMEPATH."/perltidy.ini"))) || if (has("win32") && (filereadable("perltidy.ini") ||
\ ((has("unix") || has("mac")) && (filereadable(".perltidyrc") || filereadable("~/.perltidyrc") || filereadable("/usr/local/etc/perltidyrc") || filereadable("/etc/perltidyrc"))) \ filereadable($HOMEPATH."/perltidy.ini"))) ||
let g:formatdef_perltidy = '"perltidy -q -st"' \ ((has("unix") ||
else \ has("mac")) && (filereadable(".perltidyrc") ||
let g:formatdef_perltidy = '"perltidy --perl-best-practices --format-skipping -q "' \ filereadable("~/.perltidyrc") ||
endif \ filereadable("/usr/local/etc/perltidyrc") ||
\ filereadable("/etc/perltidyrc")))
let g:formatdef_perltidy = '"perltidy -q -st"'
else
let g:formatdef_perltidy = '"perltidy --perl-best-practices --format-skipping -q "'
endif
endif endif
if !exists('g:formatters_perl') if !exists('g:formatters_perl')
let g:formatters_perl = ['perltidy'] let g:formatters_perl = ['perltidy']
endif endif
" Haskell " Haskell