On Wed, 4 May 2011, Christian Brabandt wrote:
On Mi, 04 Mai 2011, Ben Fritz wrote:
On May 4, 5:05 am, Andy Wokula wrote:
Both autocommands are independent of each other, except that the
CursorHold event will also trigger CursorHoldR autocommands.
This is because I find it confusing if the CursorHoldR event
triggers first after 2 times 'updatetime' have been passed (after
typing something), but then retriggers after every 'updatetime'
OK, makes sense, CursorHoldR should behave like CursorHold plus
retriggering. I guess that's why an additional version for Insert
mode isn't needed.
I don't follow why an additional Insert mode event would not be
needed. What if we want an action to occur repeatedly in insert mode?
If it acts like CursorHold plus retriggering, then CursorHoldR is
only usable in Normal mode.
That is easy enough to add. I have a working version ready. Should
that be called CursorRepeat/CursorRepeatI or CursorHoldRepeat/
CursorHoldRepeatI? Other suggestions?
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.)
--
Best,
Ben H
--
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