]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.646 v7.3.646
authorBram Moolenaar <Bram@vim.org>
Wed, 29 Aug 2012 16:50:54 +0000 (18:50 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 29 Aug 2012 16:50:54 +0000 (18:50 +0200)
Problem:    When reloading a buffer the undo file becomes unusable unless ":w"
            is executed. (Dmitri Frank)
Solution:   After reloading the buffer write the undo file. (Christian
            Brabandt)

src/fileio.c
src/version.c

index df694234fa385da9efcf3f3a706e82bec00dffc3..a3113d7b198e60f278900c65073284134254740e 100644 (file)
@@ -7060,8 +7060,23 @@ buf_check_timestamp(buf, focus)
     }
 
     if (reload)
+    {
        /* Reload the buffer. */
        buf_reload(buf, orig_mode);
+#ifdef FEAT_PERSISTENT_UNDO
+       if (buf->b_p_udf && buf->b_ffname != NULL)
+       {
+           char_u          hash[UNDO_HASH_SIZE];
+           buf_T           *save_curbuf = curbuf;
+
+           /* Any existing undo file is unusable, write it now. */
+           curbuf = buf;
+           u_compute_hash(hash);
+           u_write_undo(NULL, FALSE, buf, hash);
+           curbuf = save_curbuf;
+       }
+#endif
+    }
 
 #ifdef FEAT_AUTOCMD
     /* Trigger FileChangedShell when the file was changed in any way. */
index f30551b8675e1e31ec9053029cdc9f424c5c13cb..2f20fa674d009303d89516300ad53670be4fe0a9 100644 (file)
@@ -719,6 +719,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    646,
 /**/
     645,
 /**/