*lp = tv_get_number(item);
if (*lp < 0)
{
- semsg(_(e_invalid_value_for_argument_str_str), hi->hi_key, tv_get_string(item));
+ semsg(_(e_invalid_value_for_argument_str_str),
+ hi->hi_key, tv_get_string(item));
return FAIL;
}
}
}
else if (STRCMP(hi->hi_key, "term_cols") == 0)
{
+ int error = FALSE;
+
if (!(supported2 & JO2_TERM_COLS))
break;
opt->jo_set2 |= JO2_TERM_COLS;
- opt->jo_term_cols = tv_get_number(item);
+ opt->jo_term_cols = tv_get_number_chk(item, &error);
+ if (error)
+ return FAIL;
+ if (opt->jo_term_cols < 0 || opt->jo_term_cols > 1000)
+ {
+ semsg(_(e_invalid_value_for_argument_str), "term_cols");
+ return FAIL;
+ }
}
else if (STRCMP(hi->hi_key, "vertical") == 0)
{
call assert_fails("call term_start(cmd, {'term_rows': 1001})", 'E475:')
call assert_fails("call term_start(cmd, {'term_rows': 10.0})", 'E805:')
+ call assert_fails("call term_start(cmd, {'term_cols': -1})", 'E475:')
+ call assert_fails("call term_start(cmd, {'term_cols': 1001})", 'E475:')
+ call assert_fails("call term_start(cmd, {'term_cols': 10.0})", 'E805:')
+
call delete('Xtext')
endfunc