On Thu, Aug 16, 2007 at 08:33:29PM +0200, Bram Moolenaar wrote:

> > If I undo a change, and then do
> > 
> >     undojoin | delete
> > 
> > I get an error. Perhaps you could add a "undojoin!" command that
> > silently ignores the "undojoin" if the previous operation was an undo.
> 
> That is not possible.  Allowing this would corrupt the undo
> information. At least without making an effort of erasing the change
> that was undone before undojoin and fixing up the saved information.
> That means redo will not be possible.

Let me clarify what I meant:

    :undojoin!

does *nothing* if the previous change was an undo, and is equivalent to
":undojoin" if the previous change was an undo. This is certainly
possible even in a script:

    try
        undojoin
    catch
        do nothing
    endtry

But ":undojoin!" would eliminate such atrocities :).

> > Also after reading the documentation, I realize I'm unclear on the scope
> > of :undojoin. Does it mean all changes a script makes until the user
> > enters insert mode will be part of the previous undo block? Or just the
> > change immediately following the undojoin command? Could you clarify
> > this point a little in the docs?
> 
> Mostly an undo block continues until user interaction.  It's explained
> just above :undojoin.

My bad. Thanks,

GI

-- 
A 14.4 modem makes you want to get out and push!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui