diff src/ex_cmds.c @ 5231:74d2f3188cd0 v7.4a.041

updated for version 7.4a.041 Problem: When using ":new ++ff=unix" and "dos" is first in 'fileformats' then 'ff' is set to "dos" instead of "unix". (Ingo Karkat) Solution: Create set_file_options() and invoke it from do_ecmd().
author Bram Moolenaar <bram@vim.org>
date Wed, 24 Jul 2013 15:02:03 +0200
parents 2fc1f3346bfb
children f0361e297d9c
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3448,9 +3448,13 @@ do_ecmd(fnum, ffname, sfname, eap, newln
 		    curwin->w_buffer = buf;
 		    curbuf = buf;
 		    ++curbuf->b_nwindows;
-		    /* set 'fileformat' */
-		    if (*p_ffs && !oldbuf)
-			set_fileformat(default_fileformat(), OPT_LOCAL);
+
+		    /* Set 'fileformat', 'binary' and 'fenc' when forced. */
+		    if (!oldbuf && eap != NULL)
+		    {
+			set_file_options(TRUE, eap);
+			set_forced_fenc(eap);
+		    }
 		}
 
 		/* May get the window options from the last time this buffer