On Feb 23, 4:51 am, Andreas Bernauer <vim-de...@lysium.de> wrote:
> > 2. Added 'undofile'/'udf' option that toggles automatic undo file
> > writing and reading. If a file's checksum changed since the last time
> > it had an undo file written for it, Vim will silently (or loudly, with
> > verbose > 0) ignore the undo file when editing the file.
>
> Why do you use checksum? For large files, this could take very long. How about
> mtime or some other timestamp of the filesystem?
Good point, aside from some kind of rare race condition it seems like
using mtime would offer only advantages over checksumming. I'll try to
make this change sometime soon and resubmit the patch.
> Is it possible to exclude some files from undo saving?
I was thinking that there could be an option containing a list of
filename patterns that would cause undo saves not to happen, a la
cvsignore.
> Reasoning for using a binary format?
I designed the file format in an ad-hoc fashion, and it is a lot
easier to simply write out numbers than to convert everything into
strings, and design a nice format, etc. Some (possibly negligible)
advantages to using a binary format:
1. No need to do difficult parsing or include an XML library or
anything.
2. No difficulties with an 'end-of-string' marker heuristic: can just
use a null byte instead of having to pick a marker and hack to make
sure that no one can accidentally include it in their text file
3. Smaller files
4. Swap files and spell files are already in a binary format, so it
shouldn't come as a surprise for people to see a new one.
On the other hand, it would be nice to have a human-readable format.
> If the undo file is shared between systems
> that use different binary representation, things will probably go havoc.
Yep, probably.
> Without having looked into it, I guess the undo parts contain text that has
> been
> undone plus some extra information such as location and time, all of which
> could
> be represented in a text format.
There's significantly more metadata than just the things that you
mentioned, but yes, it would probably be possible to represent the
file textually.
- Jordan
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---