On 4/12/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>
> Christoph Nodes wrote:
>
> > On Tue, 11 Apr 2006 09:39:05 -0400
> > Benji Fisher <[EMAIL PROTECTED]> wrote:
> >
> > > On Tue, Apr 11, 2006 at 01:06:11PM +0200, Christoph Nodes wrote:
> > > > > >
> > > > > > Is there a way to avoid that the changes a specific command makes
> > > > > > are added to the undo history. I am missing something like
> > > > > > histdel("undo", -1).  "Set undolevels = -1" is no choice since I
> > > > > > don't want to lose the changes I made before.
> > > >
> > > > The reason for my question is our way of handling the
> > > > "Gtk-Utf-8-String-problem": Gtk-2.0 functions take UTF-8-encoded
> > > > strings as arguments. For constant strings coded into the source
> > > > code this can be a problem if you use characters not included in
> > > > the ascii character set and you don't want to have UTF-8-encoded
> > > > source files.  Our way is to let vim do the encoding and call a
> > > > vim function on every BufReadPost and BufWritePre event that uses
> > > > iconv() to convert these constant strings. These changes however,
> > > > are changes that we don't want to undo/redo.
> > > >
> > > > Christoph
> > >
> > >      If you are using vim 7.0 (still in beta testing), then you may be
> > > able to accomplish what you want with :undojoin .
> > >
> > > :help :undojoin
> > >
> > > HTH                                 --Benji Fisher
> >
> > Thanks for your hint but this is still not quite what I want. It looks
> > like as it is not possible to erase an undo history entry.
> >
> > I was wondering if there is somebody here who could have a look at the
> > patch I wrote for the vim-70d version that introduces the :undodelete
> > command. It seems to work but it is sparely tested. Maybe I am
> > overseeing something important ...
>
> This will break undo, because the text and undo information have
> different ideas of what is in the text.
>

Thanks for your prompt answer. I already thought that this is not the cream
of  the crop. However, after some further tests it still seems to work for us
(no insert or delete, only replacing some characters).

> You could perhaps skip some undo info that doesn't insert or delete
> lines, but anything else will mess up the text at some point.

Do you mean a different approach, not to add the undo information in the first
place rather than add it and delete it afterwards?

> Also: if you change a line twice, and delete the undo info for the second
> change, then undo of the first change will also undo the second change.
> Quite confusing.  Especially if you remove the change for the string and
> the user changed something before or after the string.

So far I could not confirm this, but I'll keep on testing ...

Reply via email to