aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 3cb1512bb6..c07e760469 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -335,12 +335,10 @@ void nvim_buf_set_lines(uint64_t channel_id, Buffer buffer, Integer start, Integ
return;
}
- // load buffer first if it's not loaded
- if (buf->b_ml.ml_mfp == NULL) {
- if (!buf_ensure_loaded(buf)) {
- api_set_error(err, kErrorTypeException, "Failed to load buffer");
- return;
- }
+ // Load buffer if necessary. #22670
+ if (!buf_ensure_loaded(buf)) {
+ api_set_error(err, kErrorTypeException, "Failed to load buffer");
+ return;
}
bool oob = false;
@@ -517,12 +515,10 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In
return;
}
- // load buffer first if it's not loaded
- if (buf->b_ml.ml_mfp == NULL) {
- if (!buf_ensure_loaded(buf)) {
- api_set_error(err, kErrorTypeException, "Failed to load buffer");
- return;
- }
+ // Load buffer if necessary. #22670
+ if (!buf_ensure_loaded(buf)) {
+ api_set_error(err, kErrorTypeException, "Failed to load buffer");
+ return;
}
bool oob = false;