On 4/29/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
I put  undojoin  as the first line in a function which is called by a
CursorMoved autocommand.

Then when ever the function is called, I get the message:

E790:  undojoin not allowed after undo

I assume this is because there are parts of the function which do
something that is triggering the "undo" flag, but there is nothing
that explicitly issues an 'undo'.

It seems to be working part of the time, so I'm currently trapping it
with "try", which is better than nothing.  Is there some better way to
clear the condition, or avoid it (i.e.. E790 error)?

Secondly, I wondering if "undojoin" calls  concatinate?  I.e.

- function with undojoin is called
- function makes changes and returns to user
- user issues some move commads
- function is called again and makes more changes

in this example, will all the changes made by the function in both
calls be treated as a single undo block (which is what I need, but not
getting)?

I guess another way of asking this is,  "What flags the end of the
'undojoin'"?  Is it *any* keypress from the user, or something that
changes the buffer?

I've got a function that really ought to join it's changes together
until the user initiates a change (the function is called via
CursorMoved, so it's possible will make small changes with each
keystroke).

Reply via email to