From ad64e494720663e39c163b5d9ef6e02753551e47 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 27 Jun 2011 14:14:56 +1000 Subject: [PATCH] Restore some :tabmove argument errors and update :help for recent changes. --HG-- extra : rebase_source : 496b6d553c64e88cef45620dc1f8210301ad5fe2 --- common/content/tabs.js | 5 +++-- common/locale/en-US/tabs.xml | 25 ++++++++++++++++--------- common/tests/functional/testCommands.js | 9 ++++++++- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/common/content/tabs.js b/common/content/tabs.js index f27f5e37..dabc2f31 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -763,7 +763,7 @@ var Tabs = Module("tabs", { function () { tabs.stopAll(); }, { argCount: "0" }); - // TODO: add count support + // TODO: add count and bang multimatch support - unify with :buffer nonsense commands.add(["tabm[ove]"], "Move the current tab to the position of tab N", function (args) { @@ -771,7 +771,8 @@ var Tabs = Module("tabs", { if (tabs.indexFromSpec(arg) == -1) { let tabs = [tab for (tab in matchTabs(args, true))]; - dactyl.assert(tabs.length == 1); + dactyl.assert(tabs.length, _("error.invalidArgument", arg)); + dactyl.assert(tabs.length == 1, _("buffer.multipleMatching", arg)); arg = tabs[0]; } tabs.move(tabs.getTab(), arg, args.bang); diff --git a/common/locale/en-US/tabs.xml b/common/locale/en-US/tabs.xml index 87531bd2..2c70cf8a 100644 --- a/common/locale/en-US/tabs.xml +++ b/common/locale/en-US/tabs.xml @@ -205,6 +205,7 @@ b :b :buffer :countbuffer! url|index + :countbuffer! match countb

@@ -216,8 +217,9 @@

If argument is neither a full URL nor an index but uniquely identifies a - buffer, it is selected. With ! the next buffer matching the argument is - selected, even if it cannot be identified uniquely. Use b as a + buffer, by a partial match with the URL or title, it is selected. + With ! the next buffer matching the argument is selected, + even if it cannot be identified uniquely. Use b as a shortcut to open this prompt.

@@ -285,15 +287,20 @@ :tabm :tabmove - :tabmove N - :tabmove! +N | -N + :tabmove N + :tabmove match + :tabmove! +N|-N

- Move the current tab to the position of tab N. When - N is 0, the current tab is made the first 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 the position of tab N. When N + is $, 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. +

+

+ The tab index may also be selected by a general match string + like :buffer.

diff --git a/common/tests/functional/testCommands.js b/common/tests/functional/testCommands.js index e247359e..58fbe681 100644 --- a/common/tests/functional/testCommands.js +++ b/common/tests/functional/testCommands.js @@ -677,7 +677,14 @@ var tests = { tabdo: {}, tabduplicate: {}, tablast: {}, - tabmove: {}, + tabmove: { + error: [""], + noOutput: ["1", "$", "999", "-1", "+1", "! +1", "! -1", "-999", "+999", "! +999", "! -999"], + completions: [ + ["", hasItems], + ["1", hasItems] + ] + }, tabnext: {}, tabonly: {}, tabopen: {},