On 21/03/2016 06:39, Marius Gedminas wrote:
On Sun, Mar 20, 2016 at 08:46:23AM +0000, Mike Williams wrote:
I noticed a problem with the fileformats option not being applied to the
initial buffer when VIM is started without any initial buffer content. I
mainly work on Windows and have fileformats=unix,dos so the default file
format to be unix line-endings.  However VIM on Windows starts new empty
initial buffers with dos line-endings but if I start a new buffer with :new
or :e with the name of file that did not exist then the fileformat is set to
unix line-endings.

The help says this about 'fileformats':

        Note that when Vim starts up with an empty buffer this option is not
        used.  Set 'fileformat' in your .vimrc instead.

My vimrc predates the note being added. Still, should have re-read it. At least with this change an exception case has been removed.

The following patch applies fileformats to the initial buffer created by
VIM.  I have been using it for the last 9 months without any obvious issues.
I have tested a couple of ways of feeding data into the initial buffer (such
as C:> dir | vim -) and it does what I would expect.  So can anyone see any
issues with this patch?

If you're changing the behavior, you should probably also change the
help text to match.

Very good point.

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3030,9 +3030,6 @@ A jump table for the options with a shor
          file only, the option is not changed.
        When 'binary' is set, the value of 'fileformats' is not used.

-       Note that when Vim starts up with an empty buffer this option is not
-       used.  Set 'fileformat' in your .vimrc instead.
-
For systems with a Dos-like <EOL> (<CR><NL>), when reading files that are ":source"ed and for vimrc files, automatic <EOL> detection may be
        done:



TTFN

Mike
--
There's so much comedy on television. Does that cause comedy in the streets?

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