On Thu, 17 May 2012, Christian Brabandt wrote:

Hi Benjamin!

On Do, 17 Mai 2012, Benjamin R. Haskell wrote:

If encoding conversion is necessary for the write, there are two passes through the buffer:

First pass: for every character in the buffer, ensure that it can be converted to the target encoding. (This is in memory, so it's not as time-consuming as a full "practice write" to disk.)

Second pass: write the file to disk, using the target encoding (converting on-the-fly, or however the current process works).

That is what my patch does.

The updated one? Or did I misinterpret the test results from this thread? It sounded as though the change doubled the time it would take to write a large file.


Vim simply shouldn't destroy the user's data due to a failed character conversion. Despite its rarity, it's a completely-preventable condition that Vim can detect before the original file is truncated.

Yes.

If your patch doesn't double the time it takes to write large files, and it prevents data loss, then it seems clearly to be the right thing to do.

--
Best,
Ben H

--
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