mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.1280: Ex command error cannot contain an argument
Problem: Ex command error cannot contain an argument. Solution: Add ex_errmsg() and translate earlier. Use e_trailing_arg where possible.
This commit is contained in:
@@ -1188,7 +1188,7 @@ do_bufdel(
|
|||||||
if (addr_count == 2)
|
if (addr_count == 2)
|
||||||
{
|
{
|
||||||
if (*arg) // both range and argument is not allowed
|
if (*arg) // both range and argument is not allowed
|
||||||
return _(e_trailing);
|
return ex_errmsg(e_trailing_arg, arg);
|
||||||
bnr = start_bnr;
|
bnr = start_bnr;
|
||||||
}
|
}
|
||||||
else // addr_count == 1
|
else // addr_count == 1
|
||||||
|
@@ -2570,7 +2570,7 @@ do_one_cmd(
|
|||||||
ea.errmsg = NULL;
|
ea.errmsg = NULL;
|
||||||
(cmdnames[ea.cmdidx].cmd_func)(&ea);
|
(cmdnames[ea.cmdidx].cmd_func)(&ea);
|
||||||
if (ea.errmsg != NULL)
|
if (ea.errmsg != NULL)
|
||||||
errormsg = _(ea.errmsg);
|
errormsg = ea.errmsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
@@ -2648,6 +2648,20 @@ doend:
|
|||||||
#pragma optimize( "", on )
|
#pragma optimize( "", on )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static char ex_error_buf[MSG_BUF_LEN];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return an error message with argument included.
|
||||||
|
* Uses a static buffer, only the last error will be kept.
|
||||||
|
* "msg" will be translated, caller should use N_().
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
ex_errmsg(char *msg, char_u *arg)
|
||||||
|
{
|
||||||
|
vim_snprintf(ex_error_buf, MSG_BUF_LEN, _(msg), arg);
|
||||||
|
return ex_error_buf;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse and skip over command modifiers:
|
* Parse and skip over command modifiers:
|
||||||
* - update eap->cmd
|
* - update eap->cmd
|
||||||
@@ -3989,7 +4003,8 @@ get_flags(exarg_T *eap)
|
|||||||
ex_ni(exarg_T *eap)
|
ex_ni(exarg_T *eap)
|
||||||
{
|
{
|
||||||
if (!eap->skip)
|
if (!eap->skip)
|
||||||
eap->errmsg = N_("E319: Sorry, the command is not available in this version");
|
eap->errmsg =
|
||||||
|
_("E319: Sorry, the command is not available in this version");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_EX_SCRIPT_NI
|
#ifdef HAVE_EX_SCRIPT_NI
|
||||||
@@ -4747,7 +4762,7 @@ ex_autocmd(exarg_T *eap)
|
|||||||
if (secure)
|
if (secure)
|
||||||
{
|
{
|
||||||
secure = 2;
|
secure = 2;
|
||||||
eap->errmsg = e_curdir;
|
eap->errmsg = _(e_curdir);
|
||||||
}
|
}
|
||||||
else if (eap->cmdidx == CMD_autocmd)
|
else if (eap->cmdidx == CMD_autocmd)
|
||||||
do_autocmd(eap->arg, eap->forceit);
|
do_autocmd(eap->arg, eap->forceit);
|
||||||
@@ -4798,7 +4813,7 @@ ex_buffer(exarg_T *eap)
|
|||||||
if (ERROR_IF_ANY_POPUP_WINDOW)
|
if (ERROR_IF_ANY_POPUP_WINDOW)
|
||||||
return;
|
return;
|
||||||
if (*eap->arg)
|
if (*eap->arg)
|
||||||
eap->errmsg = e_trailing;
|
eap->errmsg = ex_errmsg(e_trailing_arg, eap->arg);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (eap->addr_count == 0) // default is current buffer
|
if (eap->addr_count == 0) // default is current buffer
|
||||||
@@ -5365,7 +5380,7 @@ get_tabpage_arg(exarg_T *eap)
|
|||||||
|| tab_number > LAST_TAB_NR)
|
|| tab_number > LAST_TAB_NR)
|
||||||
{
|
{
|
||||||
// No numbers as argument.
|
// No numbers as argument.
|
||||||
eap->errmsg = e_invarg;
|
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5377,7 +5392,7 @@ get_tabpage_arg(exarg_T *eap)
|
|||||||
|| tab_number == 0)
|
|| tab_number == 0)
|
||||||
{
|
{
|
||||||
// No numbers as argument.
|
// No numbers as argument.
|
||||||
eap->errmsg = e_invarg;
|
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
tab_number = tab_number * relative + tabpage_index(curtab);
|
tab_number = tab_number * relative + tabpage_index(curtab);
|
||||||
@@ -5385,13 +5400,13 @@ get_tabpage_arg(exarg_T *eap)
|
|||||||
--tab_number;
|
--tab_number;
|
||||||
}
|
}
|
||||||
if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR)
|
if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR)
|
||||||
eap->errmsg = e_invarg;
|
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
|
||||||
}
|
}
|
||||||
else if (eap->addr_count > 0)
|
else if (eap->addr_count > 0)
|
||||||
{
|
{
|
||||||
if (unaccept_arg0 && eap->line2 == 0)
|
if (unaccept_arg0 && eap->line2 == 0)
|
||||||
{
|
{
|
||||||
eap->errmsg = e_invrange;
|
eap->errmsg = _(e_invrange);
|
||||||
tab_number = 0;
|
tab_number = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5401,7 +5416,7 @@ get_tabpage_arg(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
--tab_number;
|
--tab_number;
|
||||||
if (tab_number < unaccept_arg0)
|
if (tab_number < unaccept_arg0)
|
||||||
eap->errmsg = e_invarg;
|
eap->errmsg = _(e_invrange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5914,7 +5929,7 @@ ex_recover(exarg_T *eap)
|
|||||||
static void
|
static void
|
||||||
ex_wrongmodifier(exarg_T *eap)
|
ex_wrongmodifier(exarg_T *eap)
|
||||||
{
|
{
|
||||||
eap->errmsg = e_invcmd;
|
eap->errmsg = _(e_invcmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -6097,7 +6112,7 @@ ex_tabnext(exarg_T *eap)
|
|||||||
|| tab_number == 0)
|
|| tab_number == 0)
|
||||||
{
|
{
|
||||||
// No numbers as argument.
|
// No numbers as argument.
|
||||||
eap->errmsg = e_invarg;
|
eap->errmsg = ex_errmsg(e_invarg2, eap->arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6110,7 +6125,7 @@ ex_tabnext(exarg_T *eap)
|
|||||||
tab_number = eap->line2;
|
tab_number = eap->line2;
|
||||||
if (tab_number < 1)
|
if (tab_number < 1)
|
||||||
{
|
{
|
||||||
eap->errmsg = e_invrange;
|
eap->errmsg = _(e_invrange);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6498,7 +6513,7 @@ do_exedit(
|
|||||||
static void
|
static void
|
||||||
ex_nogui(exarg_T *eap)
|
ex_nogui(exarg_T *eap)
|
||||||
{
|
{
|
||||||
eap->errmsg = e_nogvim;
|
eap->errmsg = _(e_nogvim);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -8074,7 +8089,7 @@ ex_findpat(exarg_T *eap)
|
|||||||
|
|
||||||
// Check for trailing illegal characters
|
// Check for trailing illegal characters
|
||||||
if (!ends_excmd2(eap->arg, p))
|
if (!ends_excmd2(eap->arg, p))
|
||||||
eap->errmsg = e_trailing;
|
eap->errmsg = ex_errmsg(e_trailing_arg, p);
|
||||||
else
|
else
|
||||||
eap->nextcmd = check_nextcmd(p);
|
eap->nextcmd = check_nextcmd(p);
|
||||||
}
|
}
|
||||||
|
@@ -917,7 +917,7 @@ ex_if(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_idx == CSTACK_LEN - 1)
|
if (cstack->cs_idx == CSTACK_LEN - 1)
|
||||||
eap->errmsg = N_("E579: :if nesting too deep");
|
eap->errmsg = _("E579: :if nesting too deep");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
++cstack->cs_idx;
|
++cstack->cs_idx;
|
||||||
@@ -953,7 +953,7 @@ ex_endif(exarg_T *eap)
|
|||||||
if (eap->cstack->cs_idx < 0
|
if (eap->cstack->cs_idx < 0
|
||||||
|| (eap->cstack->cs_flags[eap->cstack->cs_idx]
|
|| (eap->cstack->cs_flags[eap->cstack->cs_idx]
|
||||||
& (CSF_WHILE | CSF_FOR | CSF_TRY)))
|
& (CSF_WHILE | CSF_FOR | CSF_TRY)))
|
||||||
eap->errmsg = N_(e_endif_without_if);
|
eap->errmsg = _(e_endif_without_if);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -997,20 +997,20 @@ ex_else(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
if (eap->cmdidx == CMD_else)
|
if (eap->cmdidx == CMD_else)
|
||||||
{
|
{
|
||||||
eap->errmsg = N_(e_else_without_if);
|
eap->errmsg = _(e_else_without_if);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eap->errmsg = N_(e_elseif_without_if);
|
eap->errmsg = _(e_elseif_without_if);
|
||||||
skip = TRUE;
|
skip = TRUE;
|
||||||
}
|
}
|
||||||
else if (cstack->cs_flags[cstack->cs_idx] & CSF_ELSE)
|
else if (cstack->cs_flags[cstack->cs_idx] & CSF_ELSE)
|
||||||
{
|
{
|
||||||
if (eap->cmdidx == CMD_else)
|
if (eap->cmdidx == CMD_else)
|
||||||
{
|
{
|
||||||
eap->errmsg = N_("E583: multiple :else");
|
eap->errmsg = _("E583: multiple :else");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eap->errmsg = N_("E584: :elseif after :else");
|
eap->errmsg = _("E584: :elseif after :else");
|
||||||
skip = TRUE;
|
skip = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1076,7 +1076,7 @@ ex_while(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_idx == CSTACK_LEN - 1)
|
if (cstack->cs_idx == CSTACK_LEN - 1)
|
||||||
eap->errmsg = N_("E585: :while/:for nesting too deep");
|
eap->errmsg = _("E585: :while/:for nesting too deep");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -1186,7 +1186,7 @@ ex_continue(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
|
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
|
||||||
eap->errmsg = N_(e_continue);
|
eap->errmsg = _(e_continue);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Try to find the matching ":while". This might stop at a try
|
// Try to find the matching ":while". This might stop at a try
|
||||||
@@ -1224,7 +1224,7 @@ ex_break(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
|
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
|
||||||
eap->errmsg = N_(e_break);
|
eap->errmsg = _(e_break);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Inactivate conditionals until the matching ":while" or a try
|
// Inactivate conditionals until the matching ":while" or a try
|
||||||
@@ -1264,7 +1264,7 @@ ex_endwhile(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
|
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
|
||||||
eap->errmsg = err;
|
eap->errmsg = _(err);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fl = cstack->cs_flags[cstack->cs_idx];
|
fl = cstack->cs_flags[cstack->cs_idx];
|
||||||
@@ -1280,9 +1280,9 @@ ex_endwhile(exarg_T *eap)
|
|||||||
if (!(fl & (CSF_WHILE | CSF_FOR)))
|
if (!(fl & (CSF_WHILE | CSF_FOR)))
|
||||||
{
|
{
|
||||||
if (!(fl & CSF_TRY))
|
if (!(fl & CSF_TRY))
|
||||||
eap->errmsg = e_endif;
|
eap->errmsg = _(e_endif);
|
||||||
else if (fl & CSF_FINALLY)
|
else if (fl & CSF_FINALLY)
|
||||||
eap->errmsg = e_endtry;
|
eap->errmsg = _(e_endtry);
|
||||||
// Try to find the matching ":while" and report what's missing.
|
// Try to find the matching ":while" and report what's missing.
|
||||||
for (idx = cstack->cs_idx; idx > 0; --idx)
|
for (idx = cstack->cs_idx; idx > 0; --idx)
|
||||||
{
|
{
|
||||||
@@ -1291,7 +1291,7 @@ ex_endwhile(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
// Give up at a try conditional not in its finally clause.
|
// Give up at a try conditional not in its finally clause.
|
||||||
// Ignore the ":endwhile"/":endfor".
|
// Ignore the ":endwhile"/":endfor".
|
||||||
eap->errmsg = err;
|
eap->errmsg = _(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fl & csf)
|
if (fl & csf)
|
||||||
@@ -1447,7 +1447,7 @@ ex_try(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_idx == CSTACK_LEN - 1)
|
if (cstack->cs_idx == CSTACK_LEN - 1)
|
||||||
eap->errmsg = N_("E601: :try nesting too deep");
|
eap->errmsg = _("E601: :try nesting too deep");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
++cstack->cs_idx;
|
++cstack->cs_idx;
|
||||||
@@ -1526,7 +1526,7 @@ ex_catch(exarg_T *eap)
|
|||||||
|
|
||||||
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
|
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
|
||||||
{
|
{
|
||||||
eap->errmsg = e_catch;
|
eap->errmsg = _(e_catch);
|
||||||
give_up = TRUE;
|
give_up = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1545,7 +1545,7 @@ ex_catch(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
// Give up for a ":catch" after ":finally" and ignore it.
|
// Give up for a ":catch" after ":finally" and ignore it.
|
||||||
// Just parse.
|
// Just parse.
|
||||||
eap->errmsg = N_("E604: :catch after :finally");
|
eap->errmsg = _("E604: :catch after :finally");
|
||||||
give_up = TRUE;
|
give_up = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1685,7 +1685,7 @@ ex_finally(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
|
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
|
||||||
eap->errmsg = e_finally;
|
eap->errmsg = _(e_finally);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
|
if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
|
||||||
@@ -1705,7 +1705,7 @@ ex_finally(exarg_T *eap)
|
|||||||
if (cstack->cs_flags[idx] & CSF_FINALLY)
|
if (cstack->cs_flags[idx] & CSF_FINALLY)
|
||||||
{
|
{
|
||||||
// Give up for a multiple ":finally" and ignore it.
|
// Give up for a multiple ":finally" and ignore it.
|
||||||
eap->errmsg = e_finally_dup;
|
eap->errmsg = _(e_finally_dup);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR,
|
rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR,
|
||||||
@@ -1814,7 +1814,7 @@ ex_endtry(exarg_T *eap)
|
|||||||
cstack_T *cstack = eap->cstack;
|
cstack_T *cstack = eap->cstack;
|
||||||
|
|
||||||
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
|
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
|
||||||
eap->errmsg = e_no_endtry;
|
eap->errmsg = _(e_no_endtry);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -2276,10 +2276,10 @@ cleanup_conditionals(
|
|||||||
get_end_emsg(cstack_T *cstack)
|
get_end_emsg(cstack_T *cstack)
|
||||||
{
|
{
|
||||||
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
|
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
|
||||||
return e_endwhile;
|
return _(e_endwhile);
|
||||||
if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR)
|
if (cstack->cs_flags[cstack->cs_idx] & CSF_FOR)
|
||||||
return e_endfor;
|
return _(e_endfor);
|
||||||
return e_endif;
|
return _(e_endif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1329,7 +1329,7 @@ ex_match(exarg_T *eap)
|
|||||||
if (*end != NUL && !ends_excmd2(end, skipwhite(end + 1)))
|
if (*end != NUL && !ends_excmd2(end, skipwhite(end + 1)))
|
||||||
{
|
{
|
||||||
vim_free(g);
|
vim_free(g);
|
||||||
eap->errmsg = e_trailing;
|
eap->errmsg = ex_errmsg(e_trailing_arg, end);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (*end != *p)
|
if (*end != *p)
|
||||||
|
@@ -5,6 +5,7 @@ int do_cmdline(char_u *cmdline, char_u *(*fgetline)(int, void *, int, int), void
|
|||||||
int getline_equal(char_u *(*fgetline)(int, void *, int, int), void *cookie, char_u *(*func)(int, void *, int, int));
|
int getline_equal(char_u *(*fgetline)(int, void *, int, int), void *cookie, char_u *(*func)(int, void *, int, int));
|
||||||
void *getline_cookie(char_u *(*fgetline)(int, void *, int, int), void *cookie);
|
void *getline_cookie(char_u *(*fgetline)(int, void *, int, int), void *cookie);
|
||||||
char_u *getline_peek(char_u *(*fgetline)(int, void *, int, int), void *cookie);
|
char_u *getline_peek(char_u *(*fgetline)(int, void *, int, int), void *cookie);
|
||||||
|
char *ex_errmsg(char *msg, char_u *arg);
|
||||||
int parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only);
|
int parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only);
|
||||||
void undo_cmdmod(exarg_T *eap, int save_msg_scroll);
|
void undo_cmdmod(exarg_T *eap, int save_msg_scroll);
|
||||||
int parse_cmd_address(exarg_T *eap, char **errormsg, int silent);
|
int parse_cmd_address(exarg_T *eap, char **errormsg, int silent);
|
||||||
|
@@ -135,18 +135,18 @@ function Test_tabpage()
|
|||||||
call assert_fails("99tabmove", 'E16:')
|
call assert_fails("99tabmove", 'E16:')
|
||||||
call assert_fails("+99tabmove", 'E16:')
|
call assert_fails("+99tabmove", 'E16:')
|
||||||
call assert_fails("-99tabmove", 'E16:')
|
call assert_fails("-99tabmove", 'E16:')
|
||||||
call assert_fails("tabmove foo", 'E474:')
|
call assert_fails("tabmove foo", 'E475:')
|
||||||
call assert_fails("tabmove 99", 'E474:')
|
call assert_fails("tabmove 99", 'E475:')
|
||||||
call assert_fails("tabmove +99", 'E474:')
|
call assert_fails("tabmove +99", 'E475:')
|
||||||
call assert_fails("tabmove -99", 'E474:')
|
call assert_fails("tabmove -99", 'E475:')
|
||||||
call assert_fails("tabmove -3+", 'E474:')
|
call assert_fails("tabmove -3+", 'E475:')
|
||||||
call assert_fails("tabmove $3", 'E474:')
|
call assert_fails("tabmove $3", 'E475:')
|
||||||
call assert_fails("%tabonly", 'E16:')
|
call assert_fails("%tabonly", 'E16:')
|
||||||
1tabonly!
|
1tabonly!
|
||||||
tabmove 1
|
tabmove 1
|
||||||
call assert_equal(1, tabpagenr())
|
call assert_equal(1, tabpagenr())
|
||||||
tabnew
|
tabnew
|
||||||
call assert_fails("-2tabmove", 'E474:')
|
call assert_fails("-2tabmove", 'E16:')
|
||||||
tabonly!
|
tabonly!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -324,14 +324,14 @@ function Test_tabpage_with_tabnext()
|
|||||||
call Check_tab_count(4, 'tabnext -', 3)
|
call Check_tab_count(4, 'tabnext -', 3)
|
||||||
call Check_tab_count(4, 'tabnext -2', 2)
|
call Check_tab_count(4, 'tabnext -2', 2)
|
||||||
call Check_tab_count(3, 'tabnext $', 5)
|
call Check_tab_count(3, 'tabnext $', 5)
|
||||||
call assert_fails('tabnext 0', 'E474:')
|
call assert_fails('tabnext 0', 'E475:')
|
||||||
call assert_fails('tabnext .', 'E474:')
|
call assert_fails('tabnext .', 'E475:')
|
||||||
call assert_fails('tabnext -+', 'E474:')
|
call assert_fails('tabnext -+', 'E475:')
|
||||||
call assert_fails('tabnext +2-', 'E474:')
|
call assert_fails('tabnext +2-', 'E475:')
|
||||||
call assert_fails('tabnext $3', 'E474:')
|
call assert_fails('tabnext $3', 'E475:')
|
||||||
call assert_fails('tabnext 99', 'E474:')
|
call assert_fails('tabnext 99', 'E475:')
|
||||||
call assert_fails('tabnext +99', 'E474:')
|
call assert_fails('tabnext +99', 'E475:')
|
||||||
call assert_fails('tabnext -99', 'E474:')
|
call assert_fails('tabnext -99', 'E475:')
|
||||||
|
|
||||||
1tabonly!
|
1tabonly!
|
||||||
endfunction
|
endfunction
|
||||||
@@ -356,7 +356,7 @@ function Test_tabpage_with_tabprevious()
|
|||||||
let err_code = 'E16:'
|
let err_code = 'E16:'
|
||||||
else
|
else
|
||||||
let entire_cmd = cmd . ' ' . c
|
let entire_cmd = cmd . ' ' . c
|
||||||
let err_code = 'E474:'
|
let err_code = 'E475:'
|
||||||
endif
|
endif
|
||||||
call assert_fails(entire_cmd, err_code)
|
call assert_fails(entire_cmd, err_code)
|
||||||
endfor
|
endfor
|
||||||
@@ -455,7 +455,7 @@ function Test_tabpage_with_tabclose()
|
|||||||
let err_code = 'E16:'
|
let err_code = 'E16:'
|
||||||
else
|
else
|
||||||
let entire_cmd = 'tabclose ' . c
|
let entire_cmd = 'tabclose ' . c
|
||||||
let err_code = 'E474:'
|
let err_code = 'E475:'
|
||||||
endif
|
endif
|
||||||
call assert_fails(entire_cmd, err_code)
|
call assert_fails(entire_cmd, err_code)
|
||||||
call assert_equal(6, tabpagenr('$'))
|
call assert_equal(6, tabpagenr('$'))
|
||||||
@@ -464,8 +464,8 @@ function Test_tabpage_with_tabclose()
|
|||||||
|
|
||||||
call assert_fails('3tabclose', 'E37:')
|
call assert_fails('3tabclose', 'E37:')
|
||||||
call assert_fails('tabclose 3', 'E37:')
|
call assert_fails('tabclose 3', 'E37:')
|
||||||
call assert_fails('tabclose -+', 'E474:')
|
call assert_fails('tabclose -+', 'E475:')
|
||||||
call assert_fails('tabclose +2-', 'E474:')
|
call assert_fails('tabclose +2-', 'E475:')
|
||||||
call assert_equal(6, tabpagenr('$'))
|
call assert_equal(6, tabpagenr('$'))
|
||||||
|
|
||||||
1tabonly!
|
1tabonly!
|
||||||
@@ -510,7 +510,7 @@ function Test_tabpage_with_tabonly()
|
|||||||
let err_code = 'E16:'
|
let err_code = 'E16:'
|
||||||
else
|
else
|
||||||
let entire_cmd = 'tabonly ' . c
|
let entire_cmd = 'tabonly ' . c
|
||||||
let err_code = 'E474:'
|
let err_code = 'E475:'
|
||||||
endif
|
endif
|
||||||
call assert_fails(entire_cmd, err_code)
|
call assert_fails(entire_cmd, err_code)
|
||||||
call assert_equal(6, tabpagenr('$'))
|
call assert_equal(6, tabpagenr('$'))
|
||||||
@@ -521,13 +521,13 @@ function Test_tabpage_with_tabonly()
|
|||||||
for c in tc
|
for c in tc
|
||||||
call s:reconstruct_tabpage_for_test(6)
|
call s:reconstruct_tabpage_for_test(6)
|
||||||
let entire_cmd = 'tabonly' . c[2] . ' ' . c[1]
|
let entire_cmd = 'tabonly' . c[2] . ' ' . c[1]
|
||||||
let err_code = 'E474:'
|
let err_code = 'E475:'
|
||||||
call assert_fails(entire_cmd, err_code)
|
call assert_fails(entire_cmd, err_code)
|
||||||
call assert_equal(6, tabpagenr('$'))
|
call assert_equal(6, tabpagenr('$'))
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
call assert_fails('tabonly -+', 'E474:')
|
call assert_fails('tabonly -+', 'E475:')
|
||||||
call assert_fails('tabonly +2-', 'E474:')
|
call assert_fails('tabonly +2-', 'E475:')
|
||||||
call assert_equal(6, tabpagenr('$'))
|
call assert_equal(6, tabpagenr('$'))
|
||||||
|
|
||||||
1tabonly!
|
1tabonly!
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1280,
|
||||||
/**/
|
/**/
|
||||||
1279,
|
1279,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user