1
0
forked from aniani/vim

patch 8.2.2670: Vim9: error for append(0, text)

Problem:    Vim9: error for append(0, text).
Solution:   Check for negative number. (closes #8022)
This commit is contained in:
Bram Moolenaar
2021-03-28 15:46:16 +02:00
parent df749a2b9c
commit b2ac7d0663
3 changed files with 7 additions and 1 deletions

View File

@@ -1621,7 +1621,7 @@ tv_get_lnum(typval_T *argvars)
if (argvars[0].v_type != VAR_STRING || !in_vim9script())
lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
if (lnum <= 0) // no valid number, try using arg like line()
if (lnum < 0) // no valid number, try using arg like line()
{
int fnum;
pos_T *fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);