We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecc83ff commit 02b0bfaCopy full SHA for 02b0bfa
autoload/clang_format.vim
@@ -92,7 +92,14 @@ function! clang_format#get_version()
92
set shell=/bin/bash
93
endif
94
try
95
- return matchlist(s:system(g:clang_format#command.' --version 2>&1'), '\(\d\+\)\.\(\d\+\)')[1:2]
+ let version_output = s:system(g:clang_format#command.' --version 2>&1')
96
+ if stridx(version_output, 'NPM') != -1
97
+ " Note:
98
+ " When clang-format is installed with npm, version string is changed (#39).
99
+ return matchlist(version_output, 'NPM version \d\+\.\d\+\.\(\d\)\(\d\+\)')[1:2]
100
+ else
101
+ return matchlist(version_output, '\(\d\+\)\.\(\d\+\)')[1:2]
102
+ endif
103
finally
104
if exists('l:shell_save')
105
let &shell = shell_save
0 commit comments