Christian Brabandt wrote:

> Hi SungHyun!
>
> On Do, 03 Jun 2010, SungHyun Nam wrote:
>
>> With vim-7.3 (+ 'undofile'):
>> I guess I could remove a undofile and run ':e' to do this.  Maybe
>> I can make a mapping with some vim script, but...
>>
>> Is there any easy way to purge 'persistence undo' history?
>
> Try setting ul=-1

I tried this:

:set undolevels?
  undolevels=4000

:set undolevels=-1
:set undolevels=4000

And the undo history was *not* purged.  Undo history is
only purged if I edit something in between the 2
":set undolevels=...":

:set undolevels=-1
.. edit something...
:set undolevels=4000
(undo history is now purged)

I'm not sure how useful it is to be able to purge undo history anyway.
I don't think I would need to do that.  What I would find more
useful, when performing multiple undos with persistent-undo, is to
display a message such as:

"undo reached state where file was last read/written"

... so that user is warned when doing multiple undos that it can
go back in time earlier than when file was last read/written if he
continues to undo.

I see an item added recently on the todo list which would also be useful:

- undofile: keep markers where the file was written/read, so that it's easy to
  go back to a saved version of the file  ":earlier 1file"?

Cheers
-- Dominique

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