diff --git a/autoload/clang_format.vim b/autoload/clang_format.vim index e73df57..bd3574c 100644 --- a/autoload/clang_format.vim +++ b/autoload/clang_format.vim @@ -109,10 +109,16 @@ endfunction function! clang_format#is_invalid() if !exists('s:command_available') - if ! executable(g:clang_format#command) - return 1 - endif - let s:command_available = 1 + " if running on windows and the path has spaces it needs to be quoted, + " but executable() get confused by the quotes, so we remove them + if has("win32") || has("win64") + if !executable(split(g:clang_format#command, '"')[0]) + return 1 + endif + else !executable(g:clang_format#command) + return 1 + endif + let s:command_available = 1 endif if !exists('s:version')