From 19d74ecfff802694c5170bdf0574e2771bb28322 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 25 Oct 2011 21:14:21 -0400 Subject: [PATCH] Fix bug. --- common/content/commandline.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/content/commandline.js b/common/content/commandline.js index bc1b0e56..c535e812 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -441,7 +441,12 @@ var CommandExMode = Class("CommandExMode", CommandMode, { prompt: ["Normal", ":"], complete: function CEM_complete(context) { - context.fork("ex", 0, completion, "ex"); + try { + context.fork("ex", 0, completion, "ex"); + } + catch (e) { + context.message = _("error.error", e); + } }, onSubmit: function CEM_onSubmit(command) { @@ -945,7 +950,7 @@ var CommandLine = Module("commandline", { dactyl.trapErrors(function () { this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) }); }, this); - this.store = this.store.slice(this.store.length - options["history"]); + this.store = this.store.slice(Math.max(0, this.store.length - options["history"])); }, /** * @property {function} Returns whether a data item should be