Permalink
Browse files

make syntax checking handle compound filetype

  • Loading branch information...
1 parent 92609bc commit 3a9c6c84754daac75696f1cd8ce2db100c0f502e @scrooloose committed Jun 30, 2009
Showing with 10 additions and 5 deletions.
  1. +10 −5 vimrc
View
@@ -122,12 +122,17 @@ function! StatuslineSyntaxWarning()
if !exists("b:statusline_syntax_warning")
let b:statusline_syntax_warning = ''
- if exists("*CheckSyntax_" . &ft) && filereadable(expand("%"))
- let first_err_line = CheckSyntax_{&ft}()
- if first_err_line != 0
- let b:statusline_syntax_warning = '[syntax:' . first_err_line . ']'
+ "if &ft is e.g. ruby.sinatra then syntax check both filetypes
+ for ft in split(&ft, '\.')
+
+ if exists("*CheckSyntax_" . ft) && filereadable(expand("%"))
+ let first_err_line = CheckSyntax_{ft}()
+ if first_err_line != 0
+ let b:statusline_syntax_warning = '[syntax:' . first_err_line . ']'
+ break
+ endif
endif
- endif
+ endfor
endif
return b:statusline_syntax_warning
endfunction

0 comments on commit 3a9c6c8

Please sign in to comment.