aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-22 18:21:15 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-08-22 18:56:43 +0800
commit09910d5b35f2432a22374e59560a1bbd08907d57 (patch)
tree8e87414d2294f68ecb7f9865213f2096633702a7 /src/nvim/eval/buffer.c
parent48722ec400eff53baa5f7bdf0aa5e933e20fb0f4 (diff)
downloadrneovim-09910d5b35f2432a22374e59560a1bbd08907d57.tar.gz
rneovim-09910d5b35f2432a22374e59560a1bbd08907d57.tar.bz2
rneovim-09910d5b35f2432a22374e59560a1bbd08907d57.zip
vim-patch:9.0.0837: append() reports failure when not appending anything
Problem: append() reports failure when not appending anything. Solution: Only report failure when appending something. (closes vim/vim#11498) https://github.com/vim/vim/commit/cd9c8d400c1eb9cbb4ff6a33be02f91a30ab13b2 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval/buffer.c')
-rw-r--r--src/nvim/eval/buffer.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/eval/buffer.c b/src/nvim/eval/buffer.c
index 0fe3f5444c..256adfd44f 100644
--- a/src/nvim/eval/buffer.c
+++ b/src/nvim/eval/buffer.c
@@ -160,10 +160,7 @@ static void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, typval_
if (lines->v_type == VAR_LIST) {
l = lines->vval.v_list;
if (l == NULL || tv_list_len(l) == 0) {
- // set proper return code
- if (lnum > curbuf->b_ml.ml_line_count) {
- rettv->vval.v_number = 1; // FAIL
- }
+ // not appending anything always succeeds
goto cleanup;
}
li = tv_list_first(l);