From f43ff849b36b1eb3307e4e549d91458e26ed7bf5 Mon Sep 17 00:00:00 2001 From: Atsushi Ezura Date: Wed, 1 Nov 2017 15:09:58 +0900 Subject: [PATCH 1/2] Fixed g:phpfmt_options not to use default if it is set on .vimrc --- plugin/phpfmt.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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") From 47857126f0fd4117bffbe0e98d4eda4e1cb08872 Mon Sep 17 00:00:00 2001 From: Atsushi Ezura Date: Wed, 1 Nov 2017 15:12:07 +0900 Subject: [PATCH 2/2] Fixed l:tmpname to fit phpcbf version 3 --- autoload/phpfmt/fmt.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)