diff options
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 1203e231ac..ecea3fc01e 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -4967,13 +4967,10 @@ int buf_check_timestamp(buf_T *buf) buf_reload(buf, orig_mode); 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; + // Any existing undo file is unusable, write it now. + u_compute_hash(buf, hash); + u_write_undo(NULL, false, buf, hash); } } |