Did you read my message carefully?

Of course, if you close Vim, then change file by another app, then open
this file in Vim again, then, expectedly, undo history should be lost.
But in my example, Vim reloads the changes after file is changed. And, at
this moment, changes aren't lost: *Vim wrote reloaded changes as just a
single change in undohistory*. This is really good, check this.

But if user close Vim now, then these changes is lost.

--
Regards,
Dmitry.

2012/8/25 James McCoy <[email protected]>

> On Sat, Aug 25, 2012 at 04:03:54PM +0400, Dmitry Frank wrote:
> > *) Make sure you have set up persistent undo in Vim.
> > *) Open any file in vim, made some changes, save the file. (changes
> needed
> > to add changesets to the undo history)
> > *) Open the same file in any different app, change it a bit and save.
> > *) Switch back to Vim, it will ask you, do you want to reload changes.
> > Reload changes, and quit Vim.
> > *) Start Vim again and open the same file. Check undotree: you will see
> > that all the tree is lost.
>
> This is expected behavior and documented under ":help persistent-undo":
>
>   Vim will
>   detect if an undo file is no longer synchronized with the file it was
> written
>   for (with a hash of the file contents) and ignore it when the file was
> changed
>   after the undo file was written, to prevent corruption.
>
> Cheers,
> --
> James
> GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>
>
> --
> 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
>

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