Skip to content

Commit c15db6d

Browse files
committed
Output of command changed, we have not to sub 1 to fetch number of file(s) edited(s).
1 parent dd3fac8 commit c15db6d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugin/php-cs-fixer.vim

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,19 @@ fun! PhpCsFixerFix(path, dry_run)
4444
exec 'edit!'
4545
endif
4646
let s:nbLines = len(split(s:output, '\n'))
47-
let s:nbFilesModified = (s:nbLines - 1)
4847

4948
if g:php_cs_fixer_verbose == 1
5049
echohl Title | echo s:output | echohl None
5150
else
52-
if s:nbFilesModified > 0
53-
echohl Title | echo "There is ".s:nbFilesModified." file(s) modified(s)" | echohl None
51+
if s:nbLines > 0
52+
echohl Title | echo s:nbLines." file(s) modified(s)" | echohl None
5453
else
5554
echohl Title | echo "There is no cs to fix" | echohl None
5655
endif
5756
endif
5857

5958
" if there is no cs to fix, we have not to ask for remove dry run
60-
if a:dry_run == 1 && s:nbFilesModified > 0
59+
if a:dry_run == 1 && s:nbLines > 0
6160
let l:confirmed = confirm("Do you want to launch command without dry-run option ?", "&Yes\n&No", 2)
6261
if l:confirmed == 1
6362
call PhpCsFixerFix(a:path, 0)

0 commit comments

Comments
 (0)