mirror of
https://github.com/vim/vim.git
synced 2025-11-13 22:54:27 -05:00
patch 8.2.2184: Vim9: no error when using "2" for a line number
Problem: Vim9: no error when using "2" for a line number. Solution: Give an error message if the line number is invalid. (closes #7492)
This commit is contained in:
@@ -2615,6 +2615,8 @@ f_cursor(typval_T *argvars, typval_T *rettv)
|
||||
else
|
||||
{
|
||||
line = tv_get_lnum(argvars);
|
||||
if (line < 0)
|
||||
semsg(_(e_invarg2), tv_get_string(&argvars[0]));
|
||||
col = (long)tv_get_number_chk(&argvars[1], NULL);
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
coladd = (long)tv_get_number_chk(&argvars[2], NULL);
|
||||
|
||||
Reference in New Issue
Block a user