]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1619 v7.4.1619
authorBram Moolenaar <Bram@vim.org>
Sun, 20 Mar 2016 16:53:25 +0000 (17:53 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 20 Mar 2016 16:53:25 +0000 (17:53 +0100)
Problem:    When 'fileformats' is set in the vimrc it applies to new buffers
            but not the initial buffer.
Solution:   Set 'fileformat' when starting up. (Mike Williams)

src/option.c
src/version.c

index 616f9a30397455c9e5adba4d65af20ec99648de6..8a706afbd17a22bef1fdf922f6d8acbd6315bd34 100644 (file)
@@ -4017,6 +4017,15 @@ set_init_3(void)
     }
 #endif
 
+    if (bufempty())
+    {
+       int idx_ffs = findoption((char_u *)"ffs");
+
+       /* Apply the first entry of 'fileformats' to the initial buffer. */
+       if (idx_ffs >= 0 && (options[idx_ffs].flags & P_WAS_SET))
+           set_fileformat(default_fileformat(), OPT_LOCAL);
+    }
+
 #ifdef FEAT_TITLE
     set_title_defaults();
 #endif
index 03a30812c923f45e107bd4c2e1ee317818a8d7fe..9136583df8023b4f2c69bbcadba41950a4a09ec5 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1619,
 /**/
     1618,
 /**/