summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2012-08-29 18:50:54 +0200
committerBram Moolenaar <bram@vim.org>2012-08-29 18:50:54 +0200
commit924c3c19a371760340e0848872473ba8ebc31596 (patch)
tree9a31b3afe06d4972a3e803ab44fbe75dc5c8751a
parent14664f6167ca9508e3699cbff4a9ca02dc7e90dc (diff)
downloadvim-924c3c19a371760340e0848872473ba8ebc31596.tar.gz
updated for version 7.3.646v7.3.646v7-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)
-rw-r--r--src/fileio.c15
-rw-r--r--src/version.c2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index df694234..a3113d7b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -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. */
diff --git a/src/version.c b/src/version.c
index f30551b8..2f20fa67 100644
--- a/src/version.c
+++ b/src/version.c
@@ -720,6 +720,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 646,
+/**/
645,
/**/
644,