0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2022-11-05 23:46:43 +00:00
parent 91c75d18d9
commit cd9c8d400c
6 changed files with 37 additions and 22 deletions

View File

@@ -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);