fix(api): handle clearing out last line of non-current buffer

fixes #24911
This commit is contained in:
bfredl
2023-08-28 12:36:00 +02:00
parent 3a876bd41b
commit 132bbd1cbd
2 changed files with 13 additions and 1 deletions

View File

@@ -2523,7 +2523,7 @@ static int ml_delete_int(buf_T *buf, linenr_T lnum, bool message)
set_keep_msg(_(no_lines_msg), 0);
}
int i = ml_replace(1, "", true);
int i = ml_replace_buf(buf, 1, "", true);
buf->b_ml.ml_flags |= ML_EMPTY;
return i;