]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.421 v7.3.421
authorBram Moolenaar <Bram@vim.org>
Sat, 28 Jan 2012 17:03:35 +0000 (18:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 28 Jan 2012 17:03:35 +0000 (18:03 +0100)
Problem:    Get E832 when setting 'undofile' in vimrc and there is a file to
            be edited on the command line. (Toothpik)
Solution:   Do not try reading the undo file for a file that wasn't loaded.

src/option.c
src/version.c

index 60956d7854f537c744eaeff0890e288fc5dce55d..033a6d2037f84c14e10beb54a9702a8ce20aa6d3 100644 (file)
@@ -7527,10 +7527,11 @@ set_bool_option(opt_idx, varp, value, opt_flags)
        {
            /* When 'undofile' is set globally: for every buffer, otherwise
             * only for the current buffer: Try to read in the undofile, if
-            * one exists and the buffer wasn't changed. */
+            * one exists and the buffer wasn't changed and the buffer was
+            * loaded. */
            if ((curbuf == save_curbuf
                                || (opt_flags & OPT_GLOBAL) || opt_flags == 0)
-                   && !curbufIsChanged())
+                   && !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL)
            {
                u_compute_hash(hash);
                u_read_undo(NULL, hash, curbuf->b_fname);
index 9f319837af48184243d8e37f86699fb7f8db0bba..b7b6ae84d148b47d4e9bdf203544edc45b0be62f 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    421,
 /**/
     420,
 /**/