From: Steve Hall <digitect@da...> - 2006-08-08 14:07:57
From: Ben Armstrong, Tue, August 08, 2006 9:22 am
> I lost an hour of work today due to the following "comedy of errors":
> 1. I edited a file for an hour.
> 2. I tested something that was needed for the document I was
> writing, sufficiently hosing the X server on my system so that I
> could not start X again.
> 3. Rather than spend all morning figuring out why, I performed a
> hard reboot.
> 4. I recovered the file from the .swp. This went swimmingly well.
> 5. I exited Cream, intending to save the file, clean up the
> no-longer-necessary .swp, and resume editing with a fresh .swp.
> 6. I failed to notice the file wasn't saved when I exited.
You weren't prompted? Hmm, could this be because the buffer is
unmodified, even though it doesn't exist?
> 7. I deleted the .swp anyway, believing it to no longer be needed.
> 8. I re-edited the file, and was horrified to discover my restored
> session had not been saved.
> Of course, you might fairly say "Well, tough luck, but this is
> clearly a case of 'user error'. You'll be more careful next time,
> won't you?" However, I just wondered if there is anything else
> Cream might do to protect me from myself. Why shouldn't the file be
> considered "modified" immediately after a successful restore from
> .swp? Apparently it wasn't, or else I wouldn't have been able to
> exit without being prompted to save the file.
What's the solution? Should we always force a .swp file to be SaveAs
Unfortunately, I'm not sure exactly how Vim manages the swap file
process internally. It is something that happens prior to Cream
though, so we'd have to design a way to discover the situation and
then react to it.
Another huge issue that might be solved by investigating this a bit
further is our current hack of turning off swapfiles when
single-session is on.
Steve Hall [ digitect dancingpaper com ]
:: Cream... something good to put in your Vim!