mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.0.1516: errors for job options are not very specific
Problem: Errors for job options are not very specific. Solution: Add more specific error messages.
This commit is contained in:
@@ -4458,7 +4458,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
return OK;
|
||||
if (tv->v_type != VAR_DICT)
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
EMSG(_(e_dictreq));
|
||||
return FAIL;
|
||||
}
|
||||
dict = tv->vval.v_dict;
|
||||
@@ -4541,7 +4541,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_io_buf[part] = get_tv_number(item);
|
||||
if (opt->jo_io_buf[part] <= 0)
|
||||
{
|
||||
EMSG2(_(e_invarg2), get_tv_string(item));
|
||||
EMSG3(_(e_invargNval), hi->hi_key, get_tv_string(item));
|
||||
return FAIL;
|
||||
}
|
||||
if (buflist_findnr(opt->jo_io_buf[part]) == NULL)
|
||||
@@ -4590,7 +4590,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
*lp = get_tv_number(item);
|
||||
if (*lp < 0)
|
||||
{
|
||||
EMSG2(_(e_invarg2), get_tv_string(item));
|
||||
EMSG3(_(e_invargNval), hi->hi_key, get_tv_string(item));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4601,7 +4601,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_set |= JO_CHANNEL;
|
||||
if (item->v_type != VAR_CHANNEL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "channel");
|
||||
EMSG2(_(e_invargval), "channel");
|
||||
return FAIL;
|
||||
}
|
||||
opt->jo_channel = item->vval.v_channel;
|
||||
@@ -4614,7 +4614,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_callback = get_callback(item, &opt->jo_partial);
|
||||
if (opt->jo_callback == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "callback");
|
||||
EMSG2(_(e_invargval), "callback");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4626,7 +4626,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_out_cb = get_callback(item, &opt->jo_out_partial);
|
||||
if (opt->jo_out_cb == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "out_cb");
|
||||
EMSG2(_(e_invargval), "out_cb");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4638,7 +4638,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_err_cb = get_callback(item, &opt->jo_err_partial);
|
||||
if (opt->jo_err_cb == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "err_cb");
|
||||
EMSG2(_(e_invargval), "err_cb");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4650,7 +4650,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_close_cb = get_callback(item, &opt->jo_close_partial);
|
||||
if (opt->jo_close_cb == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "close_cb");
|
||||
EMSG2(_(e_invargval), "close_cb");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4663,7 +4663,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
never = TRUE;
|
||||
else if (STRCMP(val, "auto") != 0)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "drop");
|
||||
EMSG3(_(e_invargNval), "drop", val);
|
||||
return FAIL;
|
||||
}
|
||||
opt->jo_drop_never = never;
|
||||
@@ -4676,7 +4676,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_exit_cb = get_callback(item, &opt->jo_exit_partial);
|
||||
if (opt->jo_exit_cb == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "exit_cb");
|
||||
EMSG2(_(e_invargval), "exit_cb");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4689,7 +4689,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_term_name = get_tv_string_chk(item);
|
||||
if (opt->jo_term_name == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "term_name");
|
||||
EMSG2(_(e_invargval), "term_name");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4700,7 +4700,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
val = get_tv_string(item);
|
||||
if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0)
|
||||
{
|
||||
EMSG2(_(e_invarg2), val);
|
||||
EMSG3(_(e_invargNval), "term_finish", val);
|
||||
return FAIL;
|
||||
}
|
||||
opt->jo_set2 |= JO2_TERM_FINISH;
|
||||
@@ -4724,7 +4724,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
}
|
||||
if (p == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "term_opencmd");
|
||||
EMSG2(_(e_invargval), "term_opencmd");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4738,7 +4738,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
p = opt->jo_eof_chars = get_tv_string_chk(item);
|
||||
if (p == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "term_opencmd");
|
||||
EMSG2(_(e_invargval), "eof_chars");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4793,7 +4793,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_cwd = get_tv_string_buf_chk(item, opt->jo_cwd_buf);
|
||||
if (opt->jo_cwd == NULL || !mch_isdir(opt->jo_cwd))
|
||||
{
|
||||
EMSG2(_(e_invarg2), "cwd");
|
||||
EMSG2(_(e_invargval), "cwd");
|
||||
return FAIL;
|
||||
}
|
||||
opt->jo_set |= JO2_CWD;
|
||||
@@ -4838,7 +4838,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_part = PART_OUT;
|
||||
else
|
||||
{
|
||||
EMSG2(_(e_invarg2), val);
|
||||
EMSG3(_(e_invargNval), "part", val);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -4858,7 +4858,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
opt->jo_soe_buf);
|
||||
if (opt->jo_stoponexit == NULL)
|
||||
{
|
||||
EMSG2(_(e_invarg2), "stoponexit");
|
||||
EMSG2(_(e_invargval), "stoponexit");
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
@@ -1437,6 +1437,8 @@ EXTERN char_u e_interr[] INIT(= N_("Interrupted"));
|
||||
EXTERN char_u e_invaddr[] INIT(= N_("E14: Invalid address"));
|
||||
EXTERN char_u e_invarg[] INIT(= N_("E474: Invalid argument"));
|
||||
EXTERN char_u e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
|
||||
EXTERN char_u e_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
|
||||
EXTERN char_u e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char_u e_invexpr2[] INIT(= N_("E15: Invalid expression: %s"));
|
||||
#endif
|
||||
|
@@ -771,6 +771,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1516,
|
||||
/**/
|
||||
1515,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user