summaryrefslogtreecommitdiff
path: root/common/content
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-03-23 12:11:27 -0400
committerKris Maglione <maglione.k@gmail.com>2011-03-23 12:11:27 -0400
commit5f4bf0537a296dfca87dee8957a551fd9e04522f (patch)
tree910858d644408a4919e09df730c6ad0e82d48a34 /common/content
parent725d884bc4cdb9bd5ce7fe4e53a6ce9c55e4600f (diff)
downloadpentadactyl-5f4bf0537a296dfca87dee8957a551fd9e04522f.tar.gz
Fix IM mode. Closes issue #457.
Diffstat (limited to 'common/content')
-rw-r--r--common/content/commandline.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/common/content/commandline.js b/common/content/commandline.js
index fd53af33..ab82fb36 100644
--- a/common/content/commandline.js
+++ b/common/content/commandline.js
@@ -804,12 +804,20 @@ var CommandLine = Module("commandline", {
// FIXME: Buggy, especially when pasting.
inputMultiline: function inputMultiline(end, callback) {
let cmd = this.command;
+ let self = {
+ end: "\n" + end + "\n",
+ callback: callback
+ };
+
modes.push(modes.INPUT_MULTILINE, null, {
- mappingSelf: {
- end: "\n" + end + "\n",
- callback: callback
- }
+ holdFocus: true,
+ leave: function leave() {
+ if (!self.done)
+ self.callback(null);
+ },
+ mappingSelf: self
});
+
if (cmd != false)
this._echoLine(cmd, this.HL_NORMAL);
@@ -1431,6 +1439,7 @@ var CommandLine = Module("commandline", {
let index = text.indexOf(self.end);
if (index >= 0) {
+ self.done = true;
text = text.substring(1, index);
modes.pop();