Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Improved a bit.

  • Loading branch information...
commit f479ade0553bc5e039b6d906ee8397acbfd04166 1 parent 654dbbf
@Shougo authored
Showing with 17 additions and 7 deletions.
  1. +17 −7 autoload/neocomplcache/sources/clang_complete.vim
View
24 autoload/neocomplcache/sources/clang_complete.vim
@@ -50,9 +50,17 @@ function s:ClangCompleteInit()
let b:clang_user_options .= ' ' . l:opt
endfor
endif
- " for l:filename in split(&path, '[,;]')
- " if l:filename != ''
- " let b:clang_user_options .= ' -I' . l:filename
+
+ " Auto parse 'path' option.
+ " let l:dirs = split(&path, '[;,]')
+ " for l:dir in l:dirs
+ " if l:dir == '' || !isdirectory(l:dir)
+ " continue
+ " endif
+
+ " " Add only absolute path.
+ " if matchstr(l:dir, '\s*/') != ''
+ " let b:clang_user_options .= ' -I' . l:dir
" endif
" endfor
@@ -188,10 +196,12 @@ function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str)
call writefile(l:buf, l:tempfile)
let l:escaped_tempfile = shellescape(l:tempfile)
- let l:command = b:clang_exec . ' -cc1 -fsyntax-only -code-completion-at='
- \ . l:escaped_tempfile . ":" . line('.') . ":" . (a:cur_keyword_pos+1)
- \ . ' ' . l:escaped_tempfile
- \ . ' ' . b:clang_parameters . ' ' . b:clang_user_options . ' -o -'
+ let l:command = b:clang_exec . ' -cc1 -fsyntax-only'
+ \ . ' -fno-caret-diagnostics -fdiagnostics-print-source-range-info'
+ \ . ' -code-completion-at='
+ \ . l:escaped_tempfile . ":" . line('.') . ":" . (a:cur_keyword_pos+1)
+ \ . ' ' . l:escaped_tempfile
+ \ . ' ' . b:clang_parameters . ' ' . b:clang_user_options . ' -o -'
let l:clang_output = split(neocomplcache#system(l:command), '\n')
call delete(l:tempfile)
if v:shell_error
Please sign in to comment.
Something went wrong with that request. Please try again.