aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-05 12:26:17 +0800
committerGitHub <noreply@github.com>2022-11-05 12:26:17 +0800
commita86295cd5c2bf15a11eb05e226fd8e226154f6a6 (patch)
tree2b92fca7058bea9087cae7fadca3e425c73b07f9 /src/nvim/eval.c
parentdaf9a63d67254342382cf79f1cd216f8e5722579 (diff)
downloadrneovim-a86295cd5c2bf15a11eb05e226fd8e226154f6a6.tar.gz
rneovim-a86295cd5c2bf15a11eb05e226fd8e226154f6a6.tar.bz2
rneovim-a86295cd5c2bf15a11eb05e226fd8e226154f6a6.zip
vim-patch:8.2.0615: regexp benchmark stest is old style (#20940)
Problem: Regexp benchmark stest is old style. Solution: Make it a new style test. Fix using a NULL list. Add more tests. (Yegappan Lakshmanan, closes vim/vim#5963) https://github.com/vim/vim/commit/ad48e6c1590842ab6d48e6caba3e9250734dae27 N/A patches: vim-patch:9.0.0829: wrong counts in macro comment
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index bc669a3e11..37da475e59 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -5581,6 +5581,13 @@ void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, const typval_T
const char *line = NULL;
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
+ }
+ goto done;
+ }
li = tv_list_first(l);
} else {
line = tv_get_string_chk(lines);
@@ -5651,6 +5658,7 @@ void set_buffer_lines(buf_T *buf, linenr_T lnum_arg, bool append, const typval_T
update_topline(curwin);
}
+done:
if (!is_curbuf) {
curbuf = curbuf_save;
curwin = curwin_save;