We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b63a52a commit 4f41742Copy full SHA for 4f41742
autoload/php_cs_fixer.vim
@@ -20,7 +20,16 @@ else
20
end
21
22
" 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/'")
+if (has('win32') || has('win64'))
24
+ if empty(matchstr(&shell, 'powershell'))
25
+ echoerr('This plugin requires PowerShell in Windows')
26
+ finish
27
+ else
28
+ let g:php_cs_fixer_version = system("(Select-String -InputObject (" . g:php_cs_fixer_version_command . ") -Pattern " . shellescape("\"([0-9])\\.\"") . ").Matches.Groups.Groups[1].value\"")
29
+ endif
30
+else
31
+ let g:php_cs_fixer_version = system(g:php_cs_fixer_version_command . " | sed -e 's/[^0-9.]*\\([0-9.]*\\).*/\\1/'")
32
+endif
33
34
if g:php_cs_fixer_version >= 2
35
let g:php_cs_fixer_rules = get(g:, 'php_cs_fixer_rules', '@PSR2')
0 commit comments