Christian wrote:

> I recently stumbled upon a potential issue with the swap file dialog 
> that I find to be "improvable". I found an old swap file for a file that 
> has been already deleted. When examining the swapfile using swapinfo(), 
> Vim told me that the swapfile was not "dirty".
> 
> While (probably) technically correct, I found the dirty: 0 (swapinfo() 
> output) and "modified: no" in the swap file exists dialog a bit 
> confusing, since it was not obviously clear, that the "modified: no" 
> corresponds to the time the swap file was written and not to the time 
> the file is read.
> 
> To be clear, the only thing I usually look at in the swap exists dialog 
> is the "modified" line and I usually just throw the swap file away, if 
> it says "no". But that might actually be wrong (or at least not 
> expected).
> 
> I wonder if the swap file exists dialog (and also the swapinfo() 
> function) could be improved:
> 
> 1) mention if the initial corresponding file still exists
> 2) check, if the swapfile contents correspond to the content of the file 
> (this could be done by storing a checksum in the swapfile similar to how 
> the undo file does it) and then mention if there is a difference between 
> those two and mention that.
> 
> 2 is potentially backwards incompatible, but it might be a good 
> improvement to the user interface.

I suppose we should mention the most important things first.  Mising the
original file seems quite important.  It's possible that it was renamed
or moved elsewhere.

A checksum is more difficult.  It's different from the undo file, since
that is only updated when writing the file.  Writing the undo file at
the same time then makes the checksum computation and storing not cause
much overhead.  The swapfile is updated every so many seconds.
Recomputing the checksum, and updating the header of the swap file does
cause overhead.  The timestamp should usually be sufficient.

-- 
hundred-and-one symptoms of being an internet addict:
147. You finally give up smoking...because it made the monitor dirty.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui