summaryrefslogtreecommitdiff
path: root/autoload/ale/c.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/ale/c.vim')
-rw-r--r--autoload/ale/c.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim
index e729aec8..4a9b80fb 100644
--- a/autoload/ale/c.vim
+++ b/autoload/ale/c.vim
@@ -585,3 +585,14 @@ function! ale#c#IncludeOptions(include_paths) abort
return join(l:option_list)
endfunction
+
+" Get the language flag depending on if the file is a header or not.
+function! ale#c#GetLanguageFlag(buffer, header_exts, linter_lang) abort
+ let l:buf_ext = expand('#' . a:buffer . ':e')
+
+ if index(a:header_exts, l:buf_ext) >= 0
+ return a:linter_lang . '-header'
+ endif
+
+ return a:linter_lang
+endfunction