mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3916: no error for passing an invalid line number to append()
Problem: No error for passing an invalid line number to append(). Solution: In Vim9 script check for a non-negative number. (closes #9417)
This commit is contained in:
@@ -151,6 +151,8 @@ set_buffer_lines(
|
||||
if (buf == NULL || (!is_curbuf && buf->b_ml.ml_mfp == NULL) || lnum < 1)
|
||||
{
|
||||
rettv->vval.v_number = 1; // FAIL
|
||||
if (in_vim9script() && lnum < 1)
|
||||
semsg(_(e_invalid_line_number_nr), lnum_arg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user