summaryrefslogtreecommitdiff
path: root/ale_linters/c
diff options
context:
space:
mode:
authorgrzebiel <marcin.grzebieluch@rst.com.pl>2016-12-24 00:17:01 +0100
committergrzebiel <marcin.grzebieluch@rst.com.pl>2016-12-24 00:18:14 +0100
commit9767fd87324977d767dda2dc6c90d2639d1326e0 (patch)
tree40afc54e06d3fc19e5a9017efbcfc722ae4c28d7 /ale_linters/c
parent55827a9493aa88ee6cffb8bce2d2cdee955d24fa (diff)
downloadale-9767fd87324977d767dda2dc6c90d2639d1326e0.zip
Added ability to reload compilation flags for c and c++ after loading plugin
Diffstat (limited to 'ale_linters/c')
-rw-r--r--ale_linters/c/gcc.vim10
1 files changed, 7 insertions, 3 deletions
diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim
index 3c18964a..583f4fab 100644
--- a/ale_linters/c/gcc.vim
+++ b/ale_linters/c/gcc.vim
@@ -9,12 +9,16 @@ if !exists('g:ale_c_gcc_options')
let g:ale_c_gcc_options = '-std=c11 -Wall'
endif
+function! ale_linters#c#gcc#GetCommand(buffer) abort
+ return 'gcc -S -x c++ -fsyntax-only '
+ \ . g:ale_c_gcc_options . ' -'
+
+endfunction
+
call ale#linter#Define('c', {
\ 'name': 'gcc',
\ 'output_stream': 'stderr',
\ 'executable': 'gcc',
-\ 'command': 'gcc -S -x c -fsyntax-only '
-\ . g:ale_c_gcc_options
-\ . ' -',
+\ 'command_callback': 'ale_linters#c#gcc#GetCommand',
\ 'callback': 'ale#handlers#HandleGCCFormat',
\})