Skip to content

Commit aa4bbd6

Browse files
committed
Add 2nd patch from @Juanitou for MS Windows.
1 parent 22405cb commit aa4bbd6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

autoload/php_cs_fixer.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ else
2020
end
2121

2222
" Check the php-cs-fixer version
23-
let g:php_cs_fixer_version = system(g:php_cs_fixer_version_command . " | sed -e 's/[^0-9.]*\\([0-9.]*\\).*/\\1/'")
23+
if (has('win32') || has('win64'))
24+
let sxq_save = &shellxquote
25+
set shellxquote&
26+
let g:php_cs_fixer_version = strpart(matchstr(system(g:php_cs_fixer_version_command), '\d\+\.\d\+\.\d\+'), 0, 1)
27+
let &shellxquote = sxq_save
28+
else
29+
let g:php_cs_fixer_version = system(g:php_cs_fixer_version_command . " | sed -e 's/[^0-9.]*\\([0-9.]*\\).*/\\1/'")
30+
endif
2431

2532
if g:php_cs_fixer_version >= 2
2633
let g:php_cs_fixer_rules = get(g:, 'php_cs_fixer_rules', '@PSR2')

0 commit comments

Comments
 (0)