On Mon, May 24, 2010 at 3:06 PM, Bram Moolenaar <[email protected]> wrote:

>
> As you may have noticed, I have added the persistent undo patch
> yesterday.  The core of this was done by Jordan Lewis.
> This means you can make changes to a file, quit Vim, edit that same file
> and undo the previous changes.
>
> I have added a few things, such as computing a hash of the text to
> verify it is equal to when the undo file was written.  That works better
> than a timestamp.
> I also changed it to put the undofile with the edited file.  That should
> work, as writing a file usually means the undofile can be written there
> as well.  It's possible to change this with the 'undodir' option.
>
> Note that despite the checks it might still be possible that the undo
> information is corruped and changes your text in unexpected ways.  Be
> careful.
>

This is excellent news! Thanks for your work.

I am a bit concerned with your decision to write undo files to the current
directory by default, though. I think that it is "impolite" to users to have
Vim store its state (especially at the 1-statefile-per-file rate that undo
persistence uses) directly in the user's working directory. It makes more
sense to me to use an undo directory within ~/.vim by default. If that
fails, then the right thing to do would be to go ahead and write in the
file's directory since, as you mentioned, it is likely to succeed.

I suppose the argument could be made that the user who has added undo
persistence to her vimrc would have read enough of the documentation to know
that she must also set undodir if she doesn't want a polluted current
working directory. I don't think that this argument is strong enough to
warrant using the new default behavior, though, since a less clued-in user
might not understand why his working directory is suddenly full of dot
files.



- Jordan Lewis

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