From b921abb6a31911793c921b66944227be27432574 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 8 Dec 2008 14:14:03 +1100 Subject: [PATCH] use argCount: "?" for :tabmove --- common/content/tabs.js | 16 ++++++++-------- vimperator/locale/en-US/tabs.txt | 13 +++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/common/content/tabs.js b/common/content/tabs.js index 2ff4e533..68ff7f11 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -508,22 +508,22 @@ function Tabs() //{{{ "Move the current tab after tab N", function (args) { - let special = args.bang; - args = args.string; + let arg = args[0]; // FIXME: tabmove! N should probably produce an error - if (!/^([+-]?\d+|)$/.test(args)) + if (arg && !/^([+-]?\d+)$/.test(arg)) { liberator.echoerr("E488: Trailing characters"); return; } - if (!args) - args = "$"; // if not specified, move to the last tab - - tabs.move(getBrowser().mCurrentTab, args, special); + // if not specified, move to after the last tab + tabs.move(getBrowser().mCurrentTab, arg || "$", args.bang); }, - { bang: true }); + { + argCount: "?", + bang: true + }); commands.add(["tabo[nly]"], "Close all other tabs", diff --git a/vimperator/locale/en-US/tabs.txt b/vimperator/locale/en-US/tabs.txt index 3e3f38ae..61e14901 100644 --- a/vimperator/locale/en-US/tabs.txt +++ b/vimperator/locale/en-US/tabs.txt @@ -128,13 +128,14 @@ ________________________________________________________________________________ |:tabm| |:tabmove| -||:tabm[ove] [N]|| + -||:tabm[ove][!] +N | -N|| + +||:tabm[ove] [a][N][a]|| + +||: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 -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 [!] is -specified the movement wraps around the start or end of the tab list. +Move the current tab to a position after tab [a]N[a]. When [a]N[a] is 0, the +current tab is made the first one. Without [a]N[a] the current tab is made the +last one. [a]N[a] can also be prefixed with "+" or "-" to indicate a relative +movement. If [!] is specified the movement wraps around the start or end of the +tab list. ________________________________________________________________________________