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
" 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

View File

@ -231,8 +231,13 @@ 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")))
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 "'