From 43ae6d7b7195517a9b91dc19464c2ff9112ccb55 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Fri, 19 Apr 2013 02:58:51 +0200 Subject: Workaround low 'updatetime' intelligently 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 :-) --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2e5b1bd..332a788 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,9 @@ Note: Like the `g:easytags_always_enabled` option, if you change this option it ### The `g:easytags_updatetime_min` option -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). +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). -### The `g:easytags_updatetime_autodisable` option - -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. +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. ### The `g:easytags_auto_update` option -- cgit v1.2.3