Skip to content

Commit 384ebf4

Browse files
committed
Add g:easytags_updatetime_warn option, improve documentation (issue #47)
Issue #47 on GitHub: #47
1 parent bff179d commit 384ebf4

File tree

3 files changed

+65
-23
lines changed

3 files changed

+65
-23
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,21 @@ Note: Like the `g:easytags_always_enabled` option, if you change this option it
125125

126126
### The `g:easytags_updatetime_min` option
127127

128-
Vim has a setting which influences how often the plug-in is automatically executed. When this setting is too low, the plug-in can break. For this reason the plug-in compensates by keeping track of when it was last executed. You'll get one warning when the plug-in first notices the low value, after that it will shut up. The default value of this option is 4000 milliseconds (4 seconds).
128+
Vim's ['updatetime'] [updatetime] option controls how often the easytags plug-in is automatically executed. A lot of popular Vim plug-ins manipulate this option to control how often they are called. Unfortunately some of those plug-ins set ['updatetime'] [updatetime] to a very low value (less than a second) and this can break the easytags plug-in.
129129

130-
If you really want the plug-in to be executed more than once every 4 seconds you can lower the minimum acceptable updatetime by setting this option (as the number of milliseconds) however note that subsecond granularity is not supported.
130+
Because of this the easytags plug-in compensates by keeping track of when it was last executed. You'll get one warning when the plug-in first notices a very low value of ['updatetime'] [updatetime], after that the plug-in will shut up (until you restart Vim) and simply compensate by not executing until its time has come. If you want to silence the warning message forever, see the `g:easytags_updatetime_warn` option.
131+
132+
The default value of Vim's ['updatetime] [updatetime] option *and* the `g:easytags_updatetime_min` option is 4000 milliseconds (4 seconds).
133+
134+
If you know what you're doing and you really want the easytags plug-in to be executed more than once every 4 seconds you can lower the minimum acceptable updatetime by setting `g:easytags_updatetime_min` to the number of milliseconds (an integer).
135+
136+
Note that although `g:easytags_updatetime_min` counts in milliseconds, the easytags plug-in does not support subsecond granularity because it is limited by Vim's [localtime()] [localtime] function which has one-second resolution.
137+
138+
### The `g:easytags_updatetime_warn` option
139+
140+
Since the easytags plug-in now compensates for low ['updatetime'] [updatetime] values (see the `g:easytags_updatetime_min` option above) the warning message shown by the easytags plug-in has become kind of redundant (and probably annoying?). For now it can be completely disabled by setting `g:easytags_updatetime_warn` to 0 (false).
141+
142+
When the feature that compensates for low ['updatetime'] [updatetime] values has proven to be a reliable workaround I will probably remove the warning message and the `g:easytags_updatetime_warn` option.
131143

132144
### The `g:easytags_auto_update` option
133145

@@ -297,6 +309,7 @@ This software is licensed under the [MIT license](http://en.wikipedia.org/wiki/M
297309
[hlinks]: http://en.wikipedia.org/wiki/Hard_link
298310
[ide]: http://en.wikipedia.org/wiki/Integrated_development_environment
299311
[jsctags]: https://npmjs.org/package/jsctags
312+
[localtime]: http://vimdoc.sourceforge.net/htmldoc/eval.html#localtime()
300313
[messages]: http://vimdoc.sourceforge.net/htmldoc/message.html#:messages
301314
[neocomplcache]: http://www.vim.org/scripts/script.php?script_id=2620
302315
[shell]: http://peterodding.com/code/vim/shell/

autoload/xolox/easytags.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Last Change: May 19, 2013
44
" URL: http://peterodding.com/code/vim/easytags/
55

6-
let g:xolox#easytags#version = '3.3.1'
6+
let g:xolox#easytags#version = '3.3.2'
77

88
call xolox#misc#compat#check('easytags', 3)
99

@@ -53,8 +53,10 @@ function! xolox#easytags#autoload(event) " {{{2
5353
let updatetime_min = xolox#misc#option#get('easytags_updatetime_min', 4000)
5454
if &updatetime < updatetime_min
5555
if s:last_automatic_run == 0
56-
" Warn once about the low &updatetime value.
57-
call xolox#misc#msg#warn("easytags.vim %s: The 'updatetime' option has an unreasonably low value, so I'll start compensating (see the easytags_updatetime_min option).", g:xolox#easytags#version)
56+
" Warn once about the low &updatetime value?
57+
if xolox#misc#option#get('easytags_updatetime_warn', 1)
58+
call xolox#misc#msg#warn("easytags.vim %s: The 'updatetime' option has an unreasonably low value, so I'll start compensating (see the easytags_updatetime_min option).", g:xolox#easytags#version)
59+
endif
5860
let s:last_automatic_run = localtime()
5961
else
6062
let next_scheduled_run = s:last_automatic_run + max([1, updatetime_min / 1000])

doc/easytags.txt

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ Contents ~
1919
6. The |g:easytags_always_enabled| option
2020
7. The |g:easytags_on_cursorhold| option
2121
8. The |g:easytags_updatetime_min| option
22-
9. The |g:easytags_auto_update| option
23-
10. The |g:easytags_auto_highlight| option
24-
11. The |g:easytags_autorecurse| option
25-
12. The |g:easytags_include_members| option
26-
13. The |g:easytags_resolve_links| option
27-
14. The |g:easytags_suppress_ctags_warning| option
28-
15. The |g:easytags_ignored_syntax_groups| option
22+
9. The |g:easytags_updatetime_warn| option
23+
10. The |g:easytags_auto_update| option
24+
11. The |g:easytags_auto_highlight| option
25+
12. The |g:easytags_autorecurse| option
26+
13. The |g:easytags_include_members| option
27+
14. The |g:easytags_resolve_links| option
28+
15. The |g:easytags_suppress_ctags_warning| option
29+
16. The |g:easytags_ignored_syntax_groups| option
2930
5. Faster syntax highlighting using Python |easytags-faster-syntax-highlighting-using-python|
3031
1. The |g:easytags_python_enabled| option
3132
2. The |g:easytags_python_script| option
@@ -291,17 +292,43 @@ your |vimrc| script.
291292
-------------------------------------------------------------------------------
292293
The *g:easytags_updatetime_min* option
293294

294-
Vim has a setting which influences how often the plug-in is automatically
295-
executed. When this setting is too low, the plug-in can break. For this reason
296-
the plug-in compensates by keeping track of when it was last executed. You'll
297-
get one warning when the plug-in first notices the low value, after that it
298-
will shut up. The default value of this option is 4000 milliseconds (4
299-
seconds).
300-
301-
If you really want the plug-in to be executed more than once every 4 seconds
302-
you can lower the minimum acceptable updatetime by setting this option (as the
303-
number of milliseconds) however note that subsecond granularity is not
304-
supported.
295+
Vim's |'updatetime'| option controls how often the easytags plug-in is
296+
automatically executed. A lot of popular Vim plug-ins manipulate this option
297+
to control how often they are called. Unfortunately some of those plug-ins set
298+
|'updatetime'| to a very low value (less than a second) and this can break the
299+
easytags plug-in.
300+
301+
Because of this the easytags plug-in compensates by keeping track of when it
302+
was last executed. You'll get one warning when the plug-in first notices a
303+
very low value of |'updatetime'|, after that the plug-in will shut up (until you
304+
restart Vim) and simply compensate by not executing until its time has come.
305+
If you want to silence the warning message forever, see the |g:easytags_updatetime_warn|
306+
option.
307+
308+
The default value of Vim's 'updatetime (see |'updatetime'|) option and the
309+
|g:easytags_updatetime_min| option is 4000 milliseconds (4 seconds).
310+
311+
If you know what you're doing and you really want the easytags plug-in to be
312+
executed more than once every 4 seconds you can lower the minimum acceptable
313+
updatetime by setting |g:easytags_updatetime_min| to the number of
314+
milliseconds (an integer).
315+
316+
Note that although |g:easytags_updatetime_min| counts in milliseconds, the
317+
easytags plug-in does not support subsecond granularity because it is limited
318+
by Vim's |localtime()| function which has one-second resolution.
319+
320+
-------------------------------------------------------------------------------
321+
The *g:easytags_updatetime_warn* option
322+
323+
Since the easytags plug-in now compensates for low |'updatetime'| values (see
324+
the |g:easytags_updatetime_min| option above) the warning message shown by the
325+
easytags plug-in has become kind of redundant (and probably annoying?). For
326+
now it can be completely disabled by setting |g:easytags_updatetime_warn| to 0
327+
(false).
328+
329+
When the feature that compensates for low |'updatetime'| values has proven to be
330+
a reliable workaround I will probably remove the warning message and the
331+
|g:easytags_updatetime_warn| option.
305332

306333
-------------------------------------------------------------------------------
307334
The *g:easytags_auto_update* option

0 commit comments

Comments
 (0)