aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-07-09 18:52:26 +0200
committerGitHub <noreply@github.com>2021-07-09 18:52:26 +0200
commit37af69285aa10b423ddaac5176328b4728012e0a (patch)
tree7d9edabdf4356b01e4a0798e5b9e6431f264db74 /src/nvim/fileio.c
parent191d3e6af7a248c86f0adde22b7768095f9c0356 (diff)
parentff53c5585f46bed9622bd4a3071c8cf3db96a9ac (diff)
downloadrneovim-37af69285aa10b423ddaac5176328b4728012e0a.tar.gz
rneovim-37af69285aa10b423ddaac5176328b4728012e0a.tar.bz2
rneovim-37af69285aa10b423ddaac5176328b4728012e0a.zip
Merge pull request #15036 from vigoux/decurbuf-2
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);
}
}