1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-15 17:15:46 +01:00

generate errors for Ex tab commands in the command rather than in v.tabs

This commit is contained in:
Doug Kearns
2007-12-02 09:07:21 +00:00
parent 85520073b4
commit 290ba70b6f
2 changed files with 25 additions and 23 deletions

View File

@@ -2050,11 +2050,24 @@ vimperator.Commands = function () //{{{
}
));
commandManager.add(new vimperator.Command(["tabm[ove]"],
function (args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); },
function (args, special)
{
// FIXME: tabmove! N should probably produce an error
if (!/^([+-]?\d+|)$/.test(args))
{
vimperator.echoerr("E488: Trailing characters");
return;
}
if (!args)
args = "$"; // if not specified, move to the last tab
vimperator.tabs.move(getBrowser().mCurrentTab, args, special);
},
{
usage: ["tabm[ove] [N]", "tabm[ove][!] +N | -N"],
shortHelp: "Move the current tab after tab N",
help: "When N is 0 the current tab is made the first one. Without N the current tab is made the last one. " +
help: "When N is 0 the current tab is made the first one. Without N the current tab is made the last one. " +
"N can also be prefixed with '+' or '-' to indicate a relative movement. If <code class=\"command\">!</code> is specified the movement wraps around the start or end of the tab list."
}
));