From 5e4c302b5bfd916214865c3c3d3808c75d137932 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 31 May 2017 20:01:40 +0100 Subject: Fix #557 - Detect C project roots and include root directories with headers, or include directories --- autoload/ale/handlers/c.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'autoload') 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 -- cgit v1.2.3