summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-01-29 16:57:34 -0500
committerKris Maglione <maglione.k@gmail.com>2011-01-29 16:57:34 -0500
commit313d2b223c64b2cef6bc28faafad1b7ac50fea00 (patch)
tree5d00e82a373139591d6277144d53dfdf29db92ea
parent9408d105eed9560b9f8e9f59a6512ba798f745eb (diff)
downloadpentadactyl-313d2b223c64b2cef6bc28faafad1b7ac50fea00.tar.gz
Fix some command-opening key bindings.
-rw-r--r--common/content/commandline.js5
-rw-r--r--common/content/commands.js11
-rw-r--r--common/content/hints.js6
-rw-r--r--common/content/tabs.js2
4 files changed, 17 insertions, 7 deletions
diff --git a/common/content/commandline.js b/common/content/commandline.js
index 0840420e..ba7616d7 100644
--- a/common/content/commandline.js
+++ b/common/content/commandline.js
@@ -322,6 +322,9 @@ var CommandMode = Class("CommandMode", {
this.widgets.active.commandline.collapsed = false;
this.widgets.prompt = this.prompt;
this.widgets.command = command || "";
+
+ if (this.completions && options["autocomplete"].length)
+ this.completions.complete(true, false);
},
get mappingSelf() this,
@@ -332,7 +335,7 @@ var CommandMode = Class("CommandMode", {
commandline.commandSession = this;
if (this.command || stack.pop && commandline.command) {
this.onChange(commandline.command);
- if (this.completions && options["autocomplete"].length)
+ if (this.completions && stack.pop)
this.completions.complete(true, false);
}
},
diff --git a/common/content/commands.js b/common/content/commands.js
index b249c009..19bc05b9 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -1321,7 +1321,10 @@ var Commands = Module("commands", {
args["-description"],
Command.bindMacro(args, "-ex",
function makeParams(args, modifiers) ({
- args: this.argCount && args.string,
+ args: {
+ __proto__: args,
+ toString: function () this.string,
+ },
bang: this.bang && args.bang ? "!" : "",
count: this.count && args.count
})),
@@ -1330,7 +1333,7 @@ var Commands = Module("commands", {
bang: args["-bang"],
count: args["-count"],
completer: completerFunc,
- literal: args["-count"] == "*" ? 0 : null,
+ literal: args["-literal"],
persist: !args["-nopersist"],
replacementText: args.literalArg,
sourcing: io.sourcing && update({}, io.sourcing)
@@ -1390,6 +1393,10 @@ var Commands = Module("commands", {
names: ["-javascript", "-js", "-j"],
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"],
description: "The allowed number of arguments",
completer: [["0", "No arguments are allowed (default)"],
diff --git a/common/content/hints.js b/common/content/hints.js
index f9bcae15..828b60de 100644
--- a/common/content/hints.js
+++ b/common/content/hints.js
@@ -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("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("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("W", "Generate a ‘:winopen URL’ prompt", function (elem, loc) CommandExMode.open("winopen " + 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("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("S", "Add a search keyword", function (elem) bookmarks.addSearchKeyword(elem));
this.addMode("v", "View hint source", function (elem, loc) buffer.viewSource(loc, false));
diff --git a/common/content/tabs.js b/common/content/tabs.js
index b76509ed..6766e388 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -910,7 +910,7 @@ var Tabs = Module("tabs", {
if (count != null)
tabs.switchTo(String(count));
else
- CommandExMode.open("buffer! ");
+ CommandExMode().open("buffer! ");
},
{ count: true });