Permalink
Browse files

updated for version 7.3.646

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)
  • Loading branch information...
1 parent 718e978 commit 7216004bc99d82e644136d0324ceeebdd41bca1c @brammool brammool committed Aug 29, 2012
Showing with 17 additions and 0 deletions.
  1. +15 −0 src/fileio.c
  2. +2 −0 src/version.c
View
@@ -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. */
View
@@ -720,6 +720,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 646,
+/**/
645,
/**/
644,

0 comments on commit 7216004

Please sign in to comment.