From cdde3b6aded5ae04c62981adc5e3129b7f5f56b2 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Mon, 2 Nov 2009 22:07:09 -0500 Subject: [PATCH] Make g:CSApprox_loaded prevent warning when -gui --- plugin/CSApprox.vim | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/plugin/CSApprox.vim b/plugin/CSApprox.vim index 2022412..5b5c0d8 100644 --- a/plugin/CSApprox.vim +++ b/plugin/CSApprox.vim @@ -54,20 +54,15 @@ " Quit if the user doesn't want or need us or is missing the gui feature. We " need +gui to be able to check the gui color settings; vim doesn't bother to " store them if it is not built with +gui. -if !has('gui') || exists('g:CSApprox_loaded') - " XXX This depends upon knowing the default for g:CSApprox_verbose_level - let s:verbose = 1 - if exists("g:CSApprox_verbose_level") - let s:verbose = g:CSApprox_verbose_level - endif - - if ! has('gui') && s:verbose > 0 +if exists('g:CSApprox_loaded') + finish +elseif ! has('gui') + " Warn unless the user set g:CSApprox_verbose_level to zero. + if get(g:, 'CSApprox_verbose_level', 1) echomsg "CSApprox needs gui support - not loading." echomsg " See :help |csapprox-+gui| for possible workarounds." endif - unlet s:verbose - finish endif