diff --git a/autoload/phpfmt/fmt.vim b/autoload/phpfmt/fmt.vim index 9cf5973..62c6b3a 100644 --- a/autoload/phpfmt/fmt.vim +++ b/autoload/phpfmt/fmt.vim @@ -34,7 +34,7 @@ function! phpfmt#fmt#format() abort "{{{ endif let l:tmpname = g:phpfmt_tmp_dir . expand('%') else - let l:tmpname = tempname() + let l:tmpname = tempname() . '.' . expand('%:e') endif call writefile(getline(1, '$'), l:tmpname) diff --git a/plugin/phpfmt.vim b/plugin/phpfmt.vim index fdd8f21..bd0f083 100644 --- a/plugin/phpfmt.vim +++ b/plugin/phpfmt.vim @@ -27,9 +27,17 @@ if !exists('g:phpfmt_command') endif if !exists('g:phpfmt_standard') - let g:phpfmt_options = '--standard=PSR2 --encoding=utf-8' + let g:phpfmt_standard = 'PSR2' else + let phpmfm_standard_is_specified = 1 +endif + +if !exists('g:phpfmt_options') let g:phpfmt_options = '--standard=' . g:phpfmt_standard . ' --encoding=utf-8' +else + if exists('phpmfm_standard_is_specified') + let g:phpfmt_options = '--standard=' . g:phpfmt_standard . ' ' . g:phpfmt_options + endif endif if !exists("g:phpfmt_experimental")