Am 04.05.2011 11:49, schrieb Christian Brabandt:
On Wed, May 4, 2011 11:19 am, Andy Wokula wrote:
Am 04.05.2011 08:59, schrieb Christian Brabandt:
Hi Bram,
attached patch fixes this issue from todo.txt:

8   Add an event like CursorHold that is triggered repeatedly, not
just once after typing something.
Need for CursorHold that retriggers.  Use a key that doesn't do
anything, or a function that resets did_cursorhold.

You use "CursorHoldR" for the event, that's a confusing name -- if
CursorHoldI is for Insert mode, then CursorHoldR must be for
Overwrite mode ... huh?

Yeah I am not happy about the name. R stands for Repeat or Retrigger.
I am open for suggestions.

What about "CursorRepeat" instead ...

If the new event is active, does this mean that the CursorHold event
never fires?

Ah, no, what you actually do is: modify CursorHold to make it trigger
repeatedly (?).  "CursorHoldRepeat"

No. after 'updatetime' passes, the CursorHold event triggers and
executes the CursorHold autocommands as well as CursorHoldR
autocommands. Afterwards, only CursorHoldR event retriggers after
every 'updatetime' passes.

OK!

Then again, what about normal CursorHold events that I only want to
get triggered after X milliseconds or Y key presses ... how will both
events work together?  Does one event influence the other?

I haven't touched the logic, after when the event will be triggered.
That means, you would have to manually check, if X milliseconds have
been passed between each invocation. Not sure what you mean with Y key
presses (there is no such event I think).

"Y keypresses" ... I confused that with swapfile syncing, please ignore.

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.

Thanks for your explanations :-)

--
Andy

--
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