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

Fix some command-opening key bindings.

This commit is contained in:
Kris Maglione
2011-01-29 16:57:34 -05:00
parent 9408d105ee
commit 313d2b223c
4 changed files with 17 additions and 7 deletions

View File

@@ -322,6 +322,9 @@ var CommandMode = Class("CommandMode", {
this.widgets.active.commandline.collapsed = false; this.widgets.active.commandline.collapsed = false;
this.widgets.prompt = this.prompt; this.widgets.prompt = this.prompt;
this.widgets.command = command || ""; this.widgets.command = command || "";
if (this.completions && options["autocomplete"].length)
this.completions.complete(true, false);
}, },
get mappingSelf() this, get mappingSelf() this,
@@ -332,7 +335,7 @@ var CommandMode = Class("CommandMode", {
commandline.commandSession = this; commandline.commandSession = this;
if (this.command || stack.pop && commandline.command) { if (this.command || stack.pop && commandline.command) {
this.onChange(commandline.command); this.onChange(commandline.command);
if (this.completions && options["autocomplete"].length) if (this.completions && stack.pop)
this.completions.complete(true, false); this.completions.complete(true, false);
} }
}, },

View File

@@ -1321,7 +1321,10 @@ var Commands = Module("commands", {
args["-description"], args["-description"],
Command.bindMacro(args, "-ex", Command.bindMacro(args, "-ex",
function makeParams(args, modifiers) ({ function makeParams(args, modifiers) ({
args: this.argCount && args.string, args: {
__proto__: args,
toString: function () this.string,
},
bang: this.bang && args.bang ? "!" : "", bang: this.bang && args.bang ? "!" : "",
count: this.count && args.count count: this.count && args.count
})), })),
@@ -1330,7 +1333,7 @@ var Commands = Module("commands", {
bang: args["-bang"], bang: args["-bang"],
count: args["-count"], count: args["-count"],
completer: completerFunc, completer: completerFunc,
literal: args["-count"] == "*" ? 0 : null, literal: args["-literal"],
persist: !args["-nopersist"], persist: !args["-nopersist"],
replacementText: args.literalArg, replacementText: args.literalArg,
sourcing: io.sourcing && update({}, io.sourcing) sourcing: io.sourcing && update({}, io.sourcing)
@@ -1389,6 +1392,10 @@ var Commands = Module("commands", {
}, { }, {
names: ["-javascript", "-js", "-j"], names: ["-javascript", "-js", "-j"],
description: "Execute the definition as JavaScript rather than Ex commands" description: "Execute the definition as JavaScript rather than Ex commands"
}, {
names: ["-literal", "-l"],
description: "Process the nth ignoring any quoting or meta characters",
type: CommandOption.INT
}, { }, {
names: ["-nargs", "-a"], names: ["-nargs", "-a"],
description: "The allowed number of arguments", description: "The allowed number of arguments",

View File

@@ -686,9 +686,9 @@ var Hints = Module("hints", {
this.addMode("t", "Follow hint in a new tab", function (elem) buffer.followLink(elem, dactyl.NEW_TAB)); this.addMode("t", "Follow hint in a new tab", function (elem) buffer.followLink(elem, dactyl.NEW_TAB));
this.addMode("b", "Follow hint in a background tab", function (elem) buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB)); this.addMode("b", "Follow hint in a background tab", function (elem) buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB));
this.addMode("w", "Follow hint in a new window", function (elem) buffer.followLink(elem, dactyl.NEW_WINDOW)); this.addMode("w", "Follow hint in a new window", function (elem) buffer.followLink(elem, dactyl.NEW_WINDOW));
this.addMode("O", "Generate an :open URL prompt", function (elem, loc) CommandExMode.open("open " + loc)); this.addMode("O", "Generate an :open URL prompt", function (elem, loc) CommandExMode().open("open " + loc));
this.addMode("T", "Generate a :tabopen URL prompt", function (elem, loc) CommandExMode.open("tabopen " + loc)); this.addMode("T", "Generate a :tabopen URL prompt", function (elem, loc) CommandExMode().open("tabopen " + loc));
this.addMode("W", "Generate a :winopen URL prompt", function (elem, loc) CommandExMode.open("winopen " + loc)); this.addMode("W", "Generate a :winopen URL prompt", function (elem, loc) CommandExMode().open("winopen " + loc));
this.addMode("a", "Add a bookmark", function (elem) bookmarks.addSearchKeyword(elem)); this.addMode("a", "Add a bookmark", function (elem) bookmarks.addSearchKeyword(elem));
this.addMode("S", "Add a search keyword", function (elem) bookmarks.addSearchKeyword(elem)); this.addMode("S", "Add a search keyword", function (elem) bookmarks.addSearchKeyword(elem));
this.addMode("v", "View hint source", function (elem, loc) buffer.viewSource(loc, false)); this.addMode("v", "View hint source", function (elem, loc) buffer.viewSource(loc, false));

View File

@@ -910,7 +910,7 @@ var Tabs = Module("tabs", {
if (count != null) if (count != null)
tabs.switchTo(String(count)); tabs.switchTo(String(count));
else else
CommandExMode.open("buffer! "); CommandExMode().open("buffer! ");
}, },
{ count: true }); { count: true });