From 100bd8df876c589c956a08a76fa4fd9eac96af2d Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sat, 17 Sep 2011 17:47:01 +0200 Subject: =?UTF-8?q?New=20g:easytags=5Fupdatetime=5Fautodisable=20option=20?= =?UTF-8?q?(issue=20#17,=20reported=20by=20Strahinja=20Markovi=C4=87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoload/xolox/easytags.vim | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'autoload') diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim index 39102e2..63d411a 100644 --- a/autoload/xolox/easytags.vim +++ b/autoload/xolox/easytags.vim @@ -1,9 +1,9 @@ " Vim script " Author: Peter Odding -" Last Change: September 5, 2011 +" Last Change: September 17, 2011 " URL: http://peterodding.com/code/vim/easytags/ -let g:xolox#easytags#version = '2.5.7' +let g:xolox#easytags#version = '2.5.8' " Public interface through (automatic) commands. {{{1 @@ -36,9 +36,24 @@ endfunction function! xolox#easytags#autoload(event) " {{{2 try - " Check for unreasonable &updatetime values. - if a:event =~? 'cursorhold' && &updatetime < 4000 - call xolox#misc#msg#warn("easytags.vim %s: I'm being executed every %i milliseconds! Please set the 'updatetime' option to >= 4000 (4 seconds). To find where 'updatetime' was changed execute ':verbose set updatetime?'", g:xolox#easytags#version, &updatetime) + if a:event =~? 'cursorhold' + " Only for the CursorHold automatic command: check for unreasonable + " &updatetime values. The minimum value 4000 is kind of arbitrary + " (apart from being Vim's default) so I made it configurable: + let updatetime_min = xolox#misc#option#get('easytags_updatetime_min', 4000) + if &updatetime < updatetime_min + " Other plug-ins may lower &updatetime in certain contexts, e.g. + " insert mode in the case of the neocomplcache plug-in. The following + " option (disabled by default unless neocomplcache is loaded) silences + " the warning and makes the easytags plug-in skip the update and + " highlight. When the &updatetime is restored to a reasonable value + " the plug-in resumes. + if xolox#misc#option#get('easytags_updatetime_autodisable', exists('g:loaded_neocomplcache')) + return + else + call xolox#misc#msg#warn("easytags.vim %s: I'm being executed every %i milliseconds! Please :set updatetime=%i. To find where 'updatetime' was changed execute ':verb set ut?'", g:xolox#easytags#version, &updatetime, updatetime_min) + endif + endif endif let do_update = xolox#misc#option#get('easytags_auto_update', 1) let do_highlight = xolox#misc#option#get('easytags_auto_highlight', 1) && &eventignore !~? '\' -- cgit v1.2.3