From 6382dc2124c78ecb9a8f38e768d71e62520f1c20 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Mon, 1 Oct 2012 15:10:53 +0100 Subject: [PATCH] Put getmatches check in a more sensible place --- plugin/syntastic.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 041337e7..97cb346f 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -54,6 +54,12 @@ if !exists("g:syntastic_enable_highlighting") let g:syntastic_enable_highlighting = 1 endif +" highlighting requires getmatches introduced in 7.1.040 +if g:syntastic_enable_highlighting == 1 && + \ (v:version < 701 || v:version == 701 && has('patch040')) + let g:syntastic_enable_highlighting = 1 +endif + if !exists("g:syntastic_echo_current_error") let g:syntastic_echo_current_error = 1 endif @@ -138,9 +144,7 @@ function! s:UpdateErrors(auto_invoked) call s:RefreshSigns() endif - " highlighting requires getmatches introduced in 7.1.040" - if g:syntastic_enable_highlighting && - \ (v:version > 702 || v:version == 701 && has('patch040')) + if g:syntastic_enable_highlighting call s:HighlightErrors() endif