0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2012-08-29 18:50:54 +02:00
parent dd7d846475
commit 465748e411
2 changed files with 17 additions and 0 deletions

View 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. */