On 18/04/09 02:43, John Beckett wrote:
>
> James Vega wrote:
>> Vim creates swapfiles expressly to ease the process of
>> recovering from problems. Whether they be the power going
>> out while they were editing, or their system crashing
>> (BSOD?), or even forgetting to close their Vim session and
>> needing to do more work from a remote connection.
>>
>> Adding the ability to easily diff the recovered buffer
>> against the on-disk file (the action recommended to the user)
>> is a valid request.
>> I've attempted to do so with vimscript, but so far haven't
>> had much luck. Providing this option natively would make a
>> lot of people's lives easier when they do have to deal with
>> recovering from whatever adverse scenario caused the swap
>> file to be left behind.
>
> Yes, I agree your suggestion would be good. Giving a more
> thoughtful answer than my previous effort, I would say that the
> issue from a developer's point of view might be that it would be
> quite hard to safely provide options that allow the user to
> proceed in all the conditions that could have caused the swap
> file to be left on disk (without sometimes luring the user into
> making a mistake that loses data).
>
> I haven't faced the issue much, so on reconsideration, I should
> have kept quiet. I can see that it would be frustrating if you
> experienced network problems that often broke a remote session
> (sometimes it's not easy to edit local copies of files).
>
> I'm not proposing the following as a solution, but I will
> mention that there is a related tip:
> http://vim.wikia.com/wiki/Swap_file_%22...%22already_exists!_-_so_diff_it
>
> John
There are two sides to this question, and I believe both are valid, even
important:
- Make all you can in order to avoid the problem happening, and to avoid
serious consequences if it does happen (sooner or later, it will).
Analyzing what you or I do differently than some other people which
results in us getting the ATTENTION message only a couple of times a
year could be of some help to some other people (I'm not saying much
help to everyone).
- When (not if) the problem happens, make sure you take the proper
action, and therefore make sure in advance that you have adequate (and
human-friendly) tools to let you decide about the proper action. Even
you and I could profit by having "friendly" tools in the rare (for us)
case that the power mains goes off while we're busily typing new data
into a file on the desktop computer. I agree that presenting a swapfile
contents in diff format compared to the disk version would be such a tool.
Best regards,
Tony.
--
Steinbach's Guideline for Systems Programming:
Never test for an error condition you don't know how to
handle.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---