Permalink
Browse files

- Fixed clang_complete initialize.

  • Loading branch information...
1 parent 9fc9f8b commit 55fee353eff341191d759784b8931e05ef027a6c @Shougo committed Oct 22, 2011
Showing with 7 additions and 3 deletions.
  1. +6 −3 autoload/neocomplcache/sources/clang_complete.vim
  2. +1 −0 doc/clang_complete.txt
@@ -63,7 +63,6 @@ function! s:init_ClangComplete()
call s:loadUserOptions()
- let b:clang_exec = g:neocomplcache_clang_executable_path
let b:clang_parameters = '-x c'
if &filetype == 'objc'
@@ -265,6 +264,10 @@ function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str)
endfunction
function! s:complete_from_clang_binary(cur_keyword_pos, cur_keyword_str)
+ if !executable(g:neocomplcache_clang_executable_path)
+ return []
+ endif
+
let buf = getline(1, '$')
let tempfile = expand('%:p:h') . '/' . localtime() . expand('%:t')
if neocomplcache#is_win()
@@ -273,7 +276,7 @@ function! s:complete_from_clang_binary(cur_keyword_pos, cur_keyword_str)
call writefile(buf, tempfile)
let escaped_tempfile = shellescape(tempfile)
- let command = b:clang_exec . ' -cc1 -fsyntax-only'
+ let command = g:neocomplcache_clang_executable_path . ' -cc1 -fsyntax-only'
\ . ' -fno-caret-diagnostics -fdiagnostics-print-source-range-info'
\ . ' -code-completion-at='
\ . escaped_tempfile . ":" . line('.') . ":" . (a:cur_keyword_pos+1)
@@ -373,7 +376,7 @@ function! s:DemangleProto(prototype)
endfunction
function! neocomplcache#sources#clang_complete#define()
- return executable('clang') ? s:source : {}
+ return s:source
endfunction
" vim: expandtab:ts=2:sts=2:sw=2
View
@@ -147,6 +147,7 @@ CHANGELOG *clang_complete-changelog*
2011-10-22
- Fixed tag.
+- Fixed clang_complete initialize.
2011-10-21
- Added documentation.

0 comments on commit 55fee35

Please sign in to comment.