1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 22:37:58 +01:00

Fix :tab extp.

This commit is contained in:
Kris Maglione
2010-09-25 10:31:37 -04:00
parent 4fc51fdb73
commit 978604a060
2 changed files with 10 additions and 4 deletions

View File

@@ -1604,6 +1604,7 @@ const Dactyl = Module("dactyl", {
commands.add(["exto[ptions]", "extp[references]"], commands.add(["exto[ptions]", "extp[references]"],
"Open an extension's preference dialog", "Open an extension's preference dialog",
function (args) { function (args) {
let tab = dactyl.forceNewTab;
AddonManager.getAddonsByTypes(["extension"], function (list) { AddonManager.getAddonsByTypes(["extension"], function (list) {
list = list.filter(function (extension) extension.name == args[0]); list = list.filter(function (extension) extension.name == args[0]);
if (!list.length || !list[0].optionsURL) if (!list.length || !list[0].optionsURL)
@@ -1611,7 +1612,7 @@ const Dactyl = Module("dactyl", {
else if (args.bang) else if (args.bang)
window.openDialog(list[0].optionsURL, "_blank", "chrome"); window.openDialog(list[0].optionsURL, "_blank", "chrome");
else else
dactyl.open(list[0].optionsURL, { from: "extoptions" }); dactyl.open(list[0].optionsURL, { from: "extoptions", where: tab && dactyl.NEW_TAB });
}); });
}, { }, {
argCount: "1", argCount: "1",

View File

@@ -590,9 +590,14 @@ const Tabs = Module("tabs", {
commands.add(["tab"], commands.add(["tab"],
"Execute a command and tell it to output in a new tab", "Execute a command and tell it to output in a new tab",
function (args) { function (args) {
dactyl.forceNewTab = true; try {
dactyl.execute(args[0], null, true); var force = dactyl.forceNewTab;
dactyl.forceNewTab = false; dactyl.forceNewTab = true;
dactyl.execute(args[0], null, true);
}
finally {
dactyl.forceNewTab = force;
}
}, { }, {
argCount: "+", argCount: "+",
completer: function (context) completion.ex(context), completer: function (context) completion.ex(context),