diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/c.vim | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index 9b428700..591a0474 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -1,8 +1,8 @@ " Author: gagbo <gagbobada@gmail.com>, w0rp <devw0rp@gmail.com>, roel0 <postelmansroel@gmail.com> " Description: Functions for integrating with C-family linters. -call ale#Set('c_parse_makefile', 0) -call ale#Set('c_parse_compile_commands', 0) +call ale#Set('c_parse_makefile', 1) +call ale#Set('c_parse_compile_commands', 1) let s:sep = has('win32') ? '\' : '/' " Set just so tests can override it. @@ -334,10 +334,6 @@ endfunction function! ale#c#GetCFlags(buffer, output) abort let l:cflags = v:null - if ale#Var(a:buffer, 'c_parse_makefile') && !empty(a:output) - let l:cflags = ale#c#ParseCFlagsFromMakeOutput(a:buffer, a:output) - endif - if ale#Var(a:buffer, 'c_parse_compile_commands') let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer) @@ -346,6 +342,12 @@ function! ale#c#GetCFlags(buffer, output) abort endif endif + if ale#Var(a:buffer, 'c_parse_makefile') + \&& !empty(a:output) + \&& !empty(l:cflags) + let l:cflags = ale#c#ParseCFlagsFromMakeOutput(a:buffer, a:output) + endif + if l:cflags is v:null let l:cflags = ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)) endif |