Skip to content

Commit c9457f4

Browse files
committed
Move the verification of existence of .phar file on the fix function.
User'll have error only when he launch the command.
1 parent 02e2e4a commit c9457f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugin/php-cs-fixer.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ if exists('g:php_cs_fixer_config')
1818
endif
1919
"}}}
2020

21-
if !filereadable(g:php_cs_fixer_path)
22-
echoerr(g:php_cs_fixer_path.' is not found')
23-
endif
2421

2522
fun! PhpCsFixerFix(path, dry_run)
23+
24+
if !filereadable(expand(g:php_cs_fixer_path))
25+
echoerr(g:php_cs_fixer_path.' is not found')
26+
endif
27+
2628
let command = g:php_cs_fixer_command.' '.a:path
2729

2830
if a:dry_run == 1

0 commit comments

Comments
 (0)