On 05/15/2012 08:42 PM, Gary Johnson wrote:
> In this scenario, the user has edited the contents of the file to
> his liking and wants to save those contents to disk. He has also
> chosen the file-encoding that he wants. He doesn't know that the
> two are incompatible. He may not even know that it's possible for
> the two to be incompatible.

How does the following sound for damage control?  If Vim
encounters an encoding error during a write, it could
automatically re-try the write with utf-8 (or whatever fail-safe
encoding makes sense) to prevent leaving the user with an empty
file.  This shouldn't cost extra time for users with valid
settings.  Since the clobbered file was of zero length anyway,
it seems that nothing further would be lost by overwriting the
empty file with data in some default encoding.  Then the error
message could be changed to mean "your encoding failed; I've
replaced your file with an encoding that will work; change your
encoding and try again if you don't like this choice".  Then, a
user with invalid settings who issues :q! will not find his file
clobbered, and users with valid settings won't be penalized with
slower writes.

Michael Henry

-- 
You received this message from the "vim_use" 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

Reply via email to