evaluate g:syntastic_check_on_open without having to restart vim

This commit is contained in:
kongo2002 2011-12-24 01:33:07 +01:00
parent 9633837e16
commit 9a9da94494

View File

@ -77,10 +77,6 @@ if !has_key(g:syntastic_mode_map, "passive_filetypes")
let g:syntastic_mode_map['passive_filetypes'] = []
endif
if !exists("g:syntastic_check_on_open")
let g:syntastic_check_on_open = 0
endif
command! SyntasticToggleMode call s:ToggleMode()
command! SyntasticCheck call s:UpdateErrors(0) <bar> redraw!
command! Errors call s:ShowLocList()
@ -93,8 +89,8 @@ augroup syntastic
autocmd cursormoved * call s:EchoCurrentError()
endif
let events = g:syntastic_check_on_open ? "BufReadPost,BufWritePost" : "BufWritePost"
exec "autocmd " . events . " * call s:UpdateErrors(1)"
autocmd BufReadPost * if exists('g:syntastic_check_on_open') && g:syntastic_check_on_open != 0 | call s:UpdateErrors(1) | endif
autocmd BufWritePost * call s:UpdateErrors(1)
autocmd BufWinEnter * if empty(&bt) | call s:AutoToggleLocList() | endif
autocmd BufWinLeave * if empty(&bt) | lclose | endif