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
|
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
|
||||||
|
@ -231,8 +231,13 @@ 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"))) ||
|
||||||
|
\ ((has("unix") ||
|
||||||
|
\ has("mac")) && (filereadable(".perltidyrc") ||
|
||||||
|
\ filereadable("~/.perltidyrc") ||
|
||||||
|
\ filereadable("/usr/local/etc/perltidyrc") ||
|
||||||
|
\ filereadable("/etc/perltidyrc")))
|
||||||
let g:formatdef_perltidy = '"perltidy -q -st"'
|
let g:formatdef_perltidy = '"perltidy -q -st"'
|
||||||
else
|
else
|
||||||
let g:formatdef_perltidy = '"perltidy --perl-best-practices --format-skipping -q "'
|
let g:formatdef_perltidy = '"perltidy --perl-best-practices --format-skipping -q "'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user