aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2021-07-09 15:10:49 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2021-07-09 15:36:07 +0200
commitff53c5585f46bed9622bd4a3071c8cf3db96a9ac (patch)
treed2f172e88748cf248be97dc0a4e5218d9ca71eec /src/nvim/fileio.c
parent9132b76da6c22bdd96af62113ff23e408fcc2ae7 (diff)
downloadrneovim-ff53c5585f46bed9622bd4a3071c8cf3db96a9ac.tar.gz
rneovim-ff53c5585f46bed9622bd4a3071c8cf3db96a9ac.tar.bz2
rneovim-ff53c5585f46bed9622bd4a3071c8cf3db96a9ac.zip
refactor(undo): don't assume curbuf in u_compute_hash
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c9
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);
}
}