On 2011-05-06, Christian Brabandt wrote:
> Hi Benjamin!
> 
> On Mi, 04 Mai 2011, Benjamin R. Haskell wrote:
> 
> > I'm not quite following all of this.  What's the use case for firing
> > an event every X milliseconds *if the user isn't moving the cursor*?
> > 
> > Wouldn't it be far more useful to have something like
> > JavaScript-style setInterval()?  (which runs a function every X
> > milliseconds, and the returned 'interval ID' can be used to stop the
> > repeating via 'clearInterval()')
> > 
> > I'd much rather see something like that make it into Vim, rather
> > than just extending CursorHold{,I} to CursorHoldRepeat{,I} simply
> > because it's fairly straightforward in terms of the implementation
> > details. (Not that I'm terribly opposed to this change; I just don't
> > see the rationale.)
> 
> While this sounds indeed interesting, I am afraid, this will be much 
> harder to implement and I don't think I can do this.

Mutt does this to check for new mail.  Each time mutt reads a key
from its input buffer, it checks the time to see if it should check
its inboxes for new mail.  It also starts a timer--I've forgotten
whether the timer is retriggered at each keystroke or when the mail
is checked--and when the timer expires it injects a dummy keystroke
into the input buffer to wake the input loop.  The code to do that
is pretty simple as I recall.

Regards,
Gary

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui