This commit is contained in:
Chiel92 2015-08-08 14:37:21 +02:00
parent 9545f0cfcf
commit 0ea8377eaa

View File

@ -60,6 +60,7 @@ endfunction
function! s:TryAllFormatters(...) range function! s:TryAllFormatters(...) range
" Make sure formatters are defined and detected " Make sure formatters are defined and detected
if !call('<SID>find_formatters', a:000) if !call('<SID>find_formatters', a:000)
" No formatters defined, so autoindent code
exe "normal gg=G" exe "normal gg=G"
return 0 return 0
endif endif
@ -106,16 +107,12 @@ function! s:TryAllFormatters(...) range
endif endif
if s:index == b:current_formatter_index if s:index == b:current_formatter_index
" Tried all formatters, none worked " Tried all formatters, none worked so autoindent code
exe "normal gg=G" exe "normal gg=G"
return 0 return 0
endif endif
endwhile endwhile
" Autoindent code if no formatters work
exe "normal gg=G"
endfunction endfunction