Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 0b47a3c9589ea8276732fa2d7913cffab356ae12 1 parent f38bcf6
@xolox authored
Showing with 8 additions and 4 deletions.
  1. +6 −2 autoload/xolox/easytags.vim
  2. +2 −2 plugin/easytags.vim
View
8 autoload/xolox/easytags.vim
@@ -3,7 +3,7 @@
" Last Change: September 4, 2011
" URL: http://peterodding.com/code/vim/easytags/
-let g:xolox#easytags#version = '2.5.1'
+let g:xolox#easytags#version = '2.5.2'
" Public interface through (automatic) commands. {{{1
@@ -34,8 +34,12 @@ function! xolox#easytags#register(global) " {{{2
endif
endfunction
-function! xolox#easytags#autoload() " {{{2
+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)
+ 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\>'
" Don't execute this function for unsupported file types (doesn't load
View
4 plugin/easytags.vim
@@ -1,6 +1,6 @@
" Vim plug-in
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: August 27, 2011
+" Last Change: September 4, 2011
" URL: http://peterodding.com/code/vim/easytags/
" Requires: Exuberant Ctags (http://ctags.sf.net)
@@ -141,7 +141,7 @@ augroup PluginEasyTags
autocmd VimEnter * call xolox#easytags#register(1)
" Define the automatic commands to perform updating/highlighting.
for s:eventname in g:easytags_events
- execute 'autocmd' s:eventname '* call xolox#easytags#autoload()'
+ execute 'autocmd' s:eventname '* call xolox#easytags#autoload(' string(s:eventname) ')'
endfor
" Define an automatic command to register file type specific tags files?
if !empty(g:easytags_by_filetype)
Please sign in to comment.
Something went wrong with that request. Please try again.