mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-25 17:31:25 +02:00
use argCount: "?" for :tabmove
This commit is contained in:
@@ -508,22 +508,22 @@ function Tabs() //{{{
|
|||||||
"Move the current tab after tab N",
|
"Move the current tab after tab N",
|
||||||
function (args)
|
function (args)
|
||||||
{
|
{
|
||||||
let special = args.bang;
|
let arg = args[0];
|
||||||
args = args.string;
|
|
||||||
|
|
||||||
// FIXME: tabmove! N should probably produce an error
|
// FIXME: tabmove! N should probably produce an error
|
||||||
if (!/^([+-]?\d+|)$/.test(args))
|
if (arg && !/^([+-]?\d+)$/.test(arg))
|
||||||
{
|
{
|
||||||
liberator.echoerr("E488: Trailing characters");
|
liberator.echoerr("E488: Trailing characters");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args)
|
// if not specified, move to after the last tab
|
||||||
args = "$"; // if not specified, move to the last tab
|
tabs.move(getBrowser().mCurrentTab, arg || "$", args.bang);
|
||||||
|
|
||||||
tabs.move(getBrowser().mCurrentTab, args, special);
|
|
||||||
},
|
},
|
||||||
{ bang: true });
|
{
|
||||||
|
argCount: "?",
|
||||||
|
bang: true
|
||||||
|
});
|
||||||
|
|
||||||
commands.add(["tabo[nly]"],
|
commands.add(["tabo[nly]"],
|
||||||
"Close all other tabs",
|
"Close all other tabs",
|
||||||
|
|||||||
@@ -128,13 +128,14 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
|
|
||||||
|:tabm| |:tabmove|
|
|:tabm| |:tabmove|
|
||||||
||:tabm[ove] [N]|| +
|
||:tabm[ove] [a][N][a]|| +
|
||||||
||:tabm[ove][!] +N | -N|| +
|
||:tabm[ove][!] [a]+N[a] | [a]-N[a]|| +
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Move the current tab to a position after tab N. When N is 0, the current tab
|
Move the current tab to a position after tab [a]N[a]. When [a]N[a] is 0, the
|
||||||
is made the first one. Without N the current tab is made the last one. N can
|
current tab is made the first one. Without [a]N[a] the current tab is made the
|
||||||
also be prefixed with "+" or "-" to indicate a relative movement. If [!] is
|
last one. [a]N[a] can also be prefixed with "+" or "-" to indicate a relative
|
||||||
specified the movement wraps around the start or end of the tab list.
|
movement. If [!] is specified the movement wraps around the start or end of the
|
||||||
|
tab list.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user