mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 9.0.0359: error message for wrong argument type is not specific
Problem: Error message for wrong argument type is not specific. Solution: Include more information in the error. (Yegappan Lakshmanan, closes #11037)
This commit is contained in:
committed by
Bram Moolenaar
parent
119167265e
commit
8deb2b30c7
20
src/time.c
20
src/time.c
@@ -805,19 +805,14 @@ f_timer_info(typval_T *argvars, typval_T *rettv)
|
||||
if (rettv_list_alloc(rettv) == FAIL)
|
||||
return;
|
||||
|
||||
if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL)
|
||||
if (check_for_opt_number_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (argvars[0].v_type != VAR_NUMBER)
|
||||
emsg(_(e_number_expected));
|
||||
else
|
||||
{
|
||||
timer = find_timer((int)tv_get_number(&argvars[0]));
|
||||
if (timer != NULL)
|
||||
add_timer_info(rettv, timer);
|
||||
}
|
||||
timer = find_timer((int)tv_get_number(&argvars[0]));
|
||||
if (timer != NULL)
|
||||
add_timer_info(rettv, timer);
|
||||
}
|
||||
else
|
||||
add_timer_info_all(rettv);
|
||||
@@ -909,14 +904,9 @@ f_timer_stop(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
timer_T *timer;
|
||||
|
||||
if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL)
|
||||
if (check_for_number_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
if (argvars[0].v_type != VAR_NUMBER)
|
||||
{
|
||||
emsg(_(e_number_expected));
|
||||
return;
|
||||
}
|
||||
timer = find_timer((int)tv_get_number(&argvars[0]));
|
||||
if (timer != NULL)
|
||||
stop_timer(timer);
|
||||
|
Reference in New Issue
Block a user