Hello Vim developers,

The help states:

,----[ :help :new ]----
| If 'fileformats' is not empty, the first format given will be
| used for the new buffer.  If 'fileformats' is empty, the
| 'fileformat' of the current buffer is used.  This can be
| overridden with the |++opt| argument.
`----

,----[ :help ++opt ]----
| The [++opt] argument can be used to force the value of 'fileformat',
| 'fileencoding' or 'binary' to a value for one command, and to specify
| the behavior for bad characters. [...]
|     ff     or  fileformat   overrides 'fileformat'
`----

Therefore, I deduce that
    :new ++ff=unix

will (on Windows, which defaults to ff=dos) open a new, unmodified
buffer with its fileformat set to "unix". This doesn't work, though:

#v+
vim -N -u NONE --cmd "set fileformats=dos,unix fileformat=dos"
" Note: Explicit settings given only to make this reproducible on all
platforms.
:setl ff?
fileformat=dos
:new ++ff=unix
:windo setl ff?
fileformat=dos  " This should read "unix"
fileformat=dos
:new +setl\ ff=unix
:setl ff? modified?
fileformat=unix " This works.
modified        " But marks the buffer "modified", which is not what one wants
with :new.
#v-

I can reproduce this with the latest Vim 7.4a.24 (huge build on
Linux/x64) down to Vim 7.0.000 on Windows/x86. Same problem when "dos"
and "unix" are swapped.

This also affects :new ++bin (binary NOT set) and :new ++enc=latin1
(fileencoding NOT set).

-- regards, ingo

-- 
-- 
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/groups/opt_out.


Raspunde prin e-mail lui