Browse files

Added option for filtering out other buffer errors

  • Loading branch information...
1 parent 2e7d733 commit 96809ab586f18a6d2e19830c08b07f3ca7977bc2 @ingemaradahl committed Oct 8, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 plugin/syntastic.vim
View
10 plugin/syntastic.vim
@@ -104,6 +104,10 @@ if !exists("g:syntastic_loc_list_height")
let g:syntastic_loc_list_height = 10
endif
+if !exists("g:syntastic_only_active_buffer")
+ let g:syntastic_only_active_buffer = 0
+endif
+
command! SyntasticToggleMode call s:ToggleMode()
command! SyntasticCheck call s:UpdateErrors(0) <bar> redraw!
command! Errors call s:ShowLocList()
@@ -203,7 +207,11 @@ function! s:CacheErrors()
if SyntasticCheckable(ft)
let errors = SyntaxCheckers_{ft}_GetLocList()
"keep only lines that effectively match an error/warning
- let errors = s:FilterLocList({'valid': 1}, errors)
+ if g:syntastic_only_active_buffer
+ let errors = s:FilterLocList({'valid': 1, 'bufnr': bufnr("%")}, errors)
+ else
+ let errors = s:FilterLocList({'valid': 1}, errors)
+ endif
"make errors have type "E" by default
call SyntasticAddToErrors(errors, {'type': 'E'})
call extend(s:LocList(), errors)

0 comments on commit 96809ab

Please sign in to comment.