Skip to content
This repository
Browse code

Warn about unreasonable 'updatetime' values (issue #16)

  • Loading branch information...
commit 0b47a3c9589ea8276732fa2d7913cffab356ae12 1 parent f38bcf6
Peter Odding authored September 04, 2011
8  autoload/xolox/easytags.vim
@@ -3,7 +3,7 @@
3 3
 " Last Change: September 4, 2011
4 4
 " URL: http://peterodding.com/code/vim/easytags/
5 5
 
6  
-let g:xolox#easytags#version = '2.5.1'
  6
+let g:xolox#easytags#version = '2.5.2'
7 7
 
8 8
 " Public interface through (automatic) commands. {{{1
9 9
 
@@ -34,8 +34,12 @@ function! xolox#easytags#register(global) " {{{2
34 34
   endif
35 35
 endfunction
36 36
 
37  
-function! xolox#easytags#autoload() " {{{2
  37
+function! xolox#easytags#autoload(event) " {{{2
38 38
   try
  39
+    " Check for unreasonable &updatetime values.
  40
+    if a:event =~? 'cursorhold' && &updatetime < 4000
  41
+      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)
  42
+    endif
39 43
     let do_update = xolox#misc#option#get('easytags_auto_update', 1)
40 44
     let do_highlight = xolox#misc#option#get('easytags_auto_highlight', 1) && &eventignore !~? '\<syntax\>'
41 45
     " Don't execute this function for unsupported file types (doesn't load
4  plugin/easytags.vim
... ...
@@ -1,6 +1,6 @@
1 1
 " Vim plug-in
2 2
 " Author: Peter Odding <peter@peterodding.com>
3  
-" Last Change: August 27, 2011
  3
+" Last Change: September 4, 2011
4 4
 " URL: http://peterodding.com/code/vim/easytags/
5 5
 " Requires: Exuberant Ctags (http://ctags.sf.net)
6 6
 
@@ -141,7 +141,7 @@ augroup PluginEasyTags
141 141
   autocmd VimEnter * call xolox#easytags#register(1)
142 142
   " Define the automatic commands to perform updating/highlighting.
143 143
   for s:eventname in g:easytags_events
144  
-    execute 'autocmd'  s:eventname '* call xolox#easytags#autoload()'
  144
+    execute 'autocmd' s:eventname '* call xolox#easytags#autoload(' string(s:eventname) ')'
145 145
   endfor
146 146
   " Define an automatic command to register file type specific tags files?
147 147
   if !empty(g:easytags_by_filetype)

0 notes on commit 0b47a3c

Please sign in to comment.
Something went wrong with that request. Please try again.