From 29daa12f8ea502dc0518caa87824ced2574a0379 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 6 Jun 2009 03:12:52 +1000 Subject: [PATCH] Add a "tabUndo" config feature. Songbird doesn't support tab undo. --- common/content/tabs.js | 19 +++++++++++++------ vimperator/content/config.js | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/common/content/tabs.js b/common/content/tabs.js index 6e768ab3..35007023 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -286,10 +286,14 @@ function Tabs() //{{{ function (count) { tabs.switchTo(null, null, count, true); }, { flags: Mappings.flags.COUNT }); - mappings.add([modes.NORMAL], ["u"], - "Undo closing of a tab", - function (count) { commands.get("undo").execute("", false, count); }, - { flags: Mappings.flags.COUNT }); + // TODO: feature dependencies - implies "session"? + if (liberator.has("tabUndo")) + { + mappings.add([modes.NORMAL], ["u"], + "Undo closing of a tab", + function (count) { commands.get("undo").execute("", false, count); }, + { flags: Mappings.flags.COUNT }); + } mappings.add([modes.NORMAL], ["", ""], "Select the alternate tab or the [count]th tab", @@ -607,8 +611,7 @@ function Tabs() //{{{ }); } - /* Why not xulmus? */ - if (liberator.has("session") && config.name != "Xulmus") + if (liberator.has("tabUndo")) { commands.add(["u[ndo]"], "Undo closing of a tab", @@ -654,6 +657,10 @@ function Tabs() //{{{ }, { argCount: "0" }); + } + + if (liberator.has("session")) + { commands.add(["wqa[ll]", "wq", "xa[ll]"], "Save the session and quit", function () { liberator.quit(true); }, diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 655abe07..c38b4483 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -32,7 +32,7 @@ const config = { //{{{ hostApplication: "Firefox", /*** optional options, there are checked for existence and a fallback provided ***/ - features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "windows"], + features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "tabUndo", "windows"], defaults: { guioptions: "rb", showtabline: 2,