diff options
author | Peter Odding <peter@peterodding.com> | 2011-09-17 17:47:01 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2011-09-17 17:47:01 +0200 |
commit | 100bd8df876c589c956a08a76fa4fd9eac96af2d (patch) | |
tree | 1aa9601ef9cec8568444b6ddd7513f61af86657a /autoload | |
parent | fae8ddd3b6cdf823113ed2a911daa7d319885f7a (diff) | |
download | vim-easytags-100bd8df876c589c956a08a76fa4fd9eac96af2d.tar.gz |
New g:easytags_updatetime_autodisable option (issue #17, reported by Strahinja Marković)
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/xolox/easytags.vim | 25 |
1 files changed, 20 insertions, 5 deletions
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 <peter@peterodding.com> -" 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 !~? '\<syntax\>' |