You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should hopefully resolve the following issues and pull
requests: #31, #33, #42. I tried several of their suggestions
in Vim 7.2 & 7.3 but it didn't work as it should IMHO.
All of the issues and pull requests seem to imply that CursorHold
events fire continuously when you set a low enough updatetime, but
in my testing on Vim 7.2 and 7.3 this is not true. The event fires
once, then Vim waits for user input before any new events fire.
I'm not sure exactly what user input is required; moving the
text cursor is not always enough but mode switching is.
So what happens (in my testing) with all of the proposed solutions is
that you stop typing for 'updatetime' milliseconds, the event fires, the
plug-in simply increments or decrements a counter and then Vim just sits
there doing absolutely nothing expect blinking the cursor...
What I'm now trying instead is to remember the last time the plug-in was
executed (the result of localtime()) and not acting on the CursorHold
event until the following condition holds true:
localtime() > (last_automatic_run + (easytags_updatetime_min/1000))
I hope this provides a reliable solution. In any case it should be
better than the previous annoying behavior :-)
Copy file name to clipboardExpand all lines: README.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,11 +125,9 @@ Note: Like the `g:easytags_always_enabled` option, if you change this option it
125
125
126
126
### The `g:easytags_updatetime_min` option
127
127
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 warns you when ['updatetime'][updatetime] is lower than 4000 milliseconds. If you really want the plug-in to be executed more than once every 4 seconds (without a warning) you can lower the minimum acceptable updatetime by setting this option (number of milliseconds).
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).
129
129
130
-
### The `g:easytags_updatetime_autodisable` option
131
-
132
-
Other plug-ins may lower the ['updatetime'][updatetime] value in certain contexts, e.g. insert mode in the case of the [neocomplcache][neocomplcache] plug-in. By setting this option to 1 (true) you can configure the easytags plug-in so that it doesn't give warnings about the updatetime option but instead skip updating and highlighting while the updatetime is set too low. When the updatetime is restored to a reasonable value the plug-in resumes.
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.
callxolox#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)
51
+
lets:last_automatic_run=localtime()
53
52
else
54
-
callxolox#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)
53
+
let next_scheduled_run =s:last_automatic_run+max([1, updatetime_min / 1000])
54
+
iflocaltime() < next_scheduled_run
55
+
" It's not our time yet; wait for the next event.
56
+
callxolox#misc#msg#debug("easytags.vim %s: Skipping this beat of 'updatetime' to compensate for low value.", g:xolox#easytags#version)
57
+
return
58
+
else
59
+
callxolox#misc#msg#debug("easytags.vim %s: This is our beat of 'updatetime'!", g:xolox#easytags#version)
0 commit comments