From cd9c8d400c1eb9cbb4ff6a33be02f91a30ab13b2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 5 Nov 2022 23:46:43 +0000 Subject: 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 #11498) --- src/evalbuffer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/evalbuffer.c') diff --git a/src/evalbuffer.c b/src/evalbuffer.c index e77435b8f4..9ce1d41aeb 100644 --- a/src/evalbuffer.c +++ b/src/evalbuffer.c @@ -175,9 +175,7 @@ set_buffer_lines( l = lines->vval.v_list; if (l == NULL || 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 done; } CHECK_LIST_MATERIALIZE(l); -- cgit v1.2.3