summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-31 20:01:40 +0100
committerw0rp <devw0rp@gmail.com>2017-05-31 20:01:47 +0100
commit5e4c302b5bfd916214865c3c3d3808c75d137932 (patch)
tree65fa154cde77dc8452024929e5226b40752ff1d0 /autoload
parent88948e0ee3729b9b31b7cfd7e0efd5fe15143621 (diff)
downloadale-5e4c302b5bfd916214865c3c3d3808c75d137932.zip
Fix #557 - Detect C project roots and include root directories with headers, or include directories
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/c.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/autoload/ale/handlers/c.vim b/autoload/ale/handlers/c.vim
index d80f5e74..266ab20a 100644
--- a/autoload/ale/handlers/c.vim
+++ b/autoload/ale/handlers/c.vim
@@ -2,7 +2,7 @@
" Desciption: Functions for integrating with C and C++ compilers.
function! ale#handlers#c#FindProjectRoot(buffer) abort
- for l:project_filename in ['Makefile', 'CMakeLists.txt']
+ for l:project_filename in ['configure', 'Makefile', 'CMakeLists.txt']
let l:full_path = ale#path#FindNearestFile(a:buffer, l:project_filename)
if !empty(l:full_path)
@@ -55,5 +55,9 @@ function! ale#handlers#c#IncludeOptions(include_paths) abort
call add(l:option_list, '-I' . ale#Escape(l:path))
endfor
- return join(l:option_list)
+ if empty(l:option_list)
+ return ''
+ endif
+
+ return ' ' . join(l:option_list) . ' '
endfunction