aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-09-23 22:45:51 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2021-07-06 19:08:32 +0200
commit763c852812c8c7e819881a76a237b6f19920f803 (patch)
treea2892e9cf4e89e5f58ed4870bf40af3f816f33f7 /src/nvim/fileio.c
parent55a2c513aafb386c01259fca711b2e0f9b85e359 (diff)
downloadrneovim-763c852812c8c7e819881a76a237b6f19920f803.tar.gz
rneovim-763c852812c8c7e819881a76a237b6f19920f803.tar.bz2
rneovim-763c852812c8c7e819881a76a237b6f19920f803.zip
undo: reduce reliance on curbuf
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 645423eafe..5d44a70a05 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -4687,7 +4687,7 @@ check_timestamps(
}
if (!stuff_empty() || global_busy || !typebuf_typed()
- || autocmd_busy || curbuf_lock > 0 || allbuf_lock > 0
+ || autocmd_busy || curbuf->b_ro_locked > 0 || allbuf_lock > 0
) {
need_check_timestamps = true; // check later
} else {
@@ -5015,10 +5015,10 @@ void buf_reload(buf_T *buf, int orig_mode)
old_topline = curwin->w_topline;
if (p_ur < 0 || curbuf->b_ml.ml_line_count <= p_ur) {
- /* Save all the text, so that the reload can be undone.
- * Sync first so that this is a separate undo-able action. */
- u_sync(FALSE);
- saved = u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE);
+ // Save all the text, so that the reload can be undone.
+ // Sync first so that this is a separate undo-able action.
+ u_sync(false);
+ saved = u_savecommon(curbuf, 0, curbuf->b_ml.ml_line_count + 1, 0, true);
flags |= READ_KEEP_UNDO;
}