minor changes & formatting changes
This commit is contained in:
parent
11023a0f27
commit
cb4f717fbe
@ -13,7 +13,7 @@ function! s:find_formatters(...)
|
||||
let ftype = a:0 ? a:1 : &filetype
|
||||
" Support composite filetypes by replacing dots with underscores
|
||||
let compoundtype = substitute(ftype, "[.]", "_", "g")
|
||||
if ftype =~ "[.]"
|
||||
if ftype =~? "[.]"
|
||||
" Try all super filetypes in search for formatters in a sane order
|
||||
let ftypes = [compoundtype] + split(ftype, "[.]")
|
||||
else
|
||||
@ -37,11 +37,11 @@ function! s:find_formatters(...)
|
||||
if !exists(formatters_var)
|
||||
" No formatters defined
|
||||
if verbose
|
||||
echoerr "No formatters defined for supertype '".supertype
|
||||
echoerr "No formatters defined for supertype ".supertype
|
||||
endif
|
||||
else
|
||||
let formatters = eval(formatters_var)
|
||||
if type(formatters) != 3
|
||||
if type(formatters) != type([])
|
||||
echoerr formatter_var." is not a list"
|
||||
else
|
||||
let b:formatters = b:formatters + formatters
|
||||
|
@ -230,17 +230,22 @@ endif
|
||||
|
||||
" Perl
|
||||
if !exists('g:formatdef_perltidy')
|
||||
" use perltidyrc file if readable
|
||||
if (has("win32") && (filereadable("perltidy.ini") || filereadable($HOMEPATH."/perltidy.ini"))) ||
|
||||
\ ((has("unix") || has("mac")) && (filereadable(".perltidyrc") || filereadable("~/.perltidyrc") || 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
|
||||
" use perltidyrc file if readable
|
||||
if (has("win32") && (filereadable("perltidy.ini") ||
|
||||
\ filereadable($HOMEPATH."/perltidy.ini"))) ||
|
||||
\ ((has("unix") ||
|
||||
\ has("mac")) && (filereadable(".perltidyrc") ||
|
||||
\ filereadable("~/.perltidyrc") ||
|
||||
\ 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
|
||||
|
||||
if !exists('g:formatters_perl')
|
||||
let g:formatters_perl = ['perltidy']
|
||||
let g:formatters_perl = ['perltidy']
|
||||
endif
|
||||
|
||||
" Haskell
|
||||
|
Loading…
x
Reference in New Issue
Block a user