Jordan Lewis wrote:

> --0016e68ee46947c7a104875ce992
> Content-Type: text/plain; charset=ISO-8859-1
> 
> 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.

When editing a file over a network or a removable media (USB stick) it's
very easy to misplace the undo file.  Also, when a file is edited by
several people, or the same person with different login names or from
different systems, the undo file would go in the wrong place.  Also
problems with renaming a directory, moving a directory tree, backups,
etc.

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

It's a bit like using backup files.  The undo files are hidden (start
with a dot), thus are less intrusive.  It's also like swap files, they
also go in the same directory as the file, by default.  Still, when a
directory is not writable swap files need to go elsewhere.  Undo files
won't be written when a file is not writable.

-- 
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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