From 2cf32d7be3f1704bdc0e9c267b2ea031041dca81 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Tue, 14 Apr 2015 10:53:30 +0300 Subject: [PATCH] Bug fix: b:cflags applies only to C and C++ checkers. --- autoload/syntastic/c.vim | 18 +++++++++--------- plugin/syntastic.vim | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoload/syntastic/c.vim b/autoload/syntastic/c.vim index 9fcb8908..1c7d86a1 100644 --- a/autoload/syntastic/c.vim +++ b/autoload/syntastic/c.vim @@ -221,12 +221,12 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2 let flags .= ' ' . s:_get_checker_var('g', a:ft, a:ck, 'compiler_options', '') . ' ' . s:_get_include_dirs(a:ft) - " check if the user manually set some cflags - let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '') - if b_cflags ==# '' - " check whether to search for include files at all - if !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0) - if a:ft ==# 'c' || a:ft ==# 'cpp' + if a:ft ==# 'c' || a:ft ==# 'cpp' + " check if the user manually set some cflags + let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '') + if b_cflags ==# '' + " check whether to search for include files at all + if !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0) " refresh the include file search if desired if s:_get_checker_var('g', a:ft, a:ck, 'auto_refresh_includes', 0) let flags .= ' ' . s:_search_headers() @@ -238,10 +238,10 @@ function! s:_get_cflags(ft, ck, opts) abort " {{{2 let flags .= ' ' . b:syntastic_{a:ft}_includes endif endif + else + " user-defined cflags + let flags .= ' ' . b_cflags endif - else - " user-defined cflags - let flags .= ' ' . b_cflags endif " add optional config file parameters diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 9d2e1588..6b41fbf4 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.6.0-70' +let g:_SYNTASTIC_VERSION = '3.6.0-71' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1