diff --git a/common/content/commandline.js b/common/content/commandline.js index f0fc5e7f..fa2539d8 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1342,10 +1342,10 @@ const CommandLine = Module("commandline", { this._caret = this.caret; }, - get caret() this.editor.selection.focusOffset, + get caret() this.editor.selection.getRangeAt(0).startOffset, set caret(offset) { - commandline.widgets.active.command.selectionStart = offset; - commandline.widgets.active.command.selectionEnd = offset; + this.editor.selection.getRangeAt(0).setStart(this.editor.rootElement.firstChild, offset); + this.editor.selection.getRangeAt(0).setEnd(this.editor.rootElement.firstChild, offset); }, get start() this.context.allItems.start, @@ -1394,6 +1394,7 @@ const CommandLine = Module("commandline", { // Don't show 1-character substrings unless we've just hit backspace if (substring.length < 2 && (!this._lastSubstring || this._lastSubstring.indexOf(substring) != 0)) return; + this._lastSubstring = substring; let value = this.completion; diff --git a/common/modules/util.jsm b/common/modules/util.jsm index e1f35952..9dfae270 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -971,7 +971,7 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]) * @param {RegExp} re The regexp showable source of which is to be returned. * @returns {string} */ - getSource: function regexp_getSource(re) re.source.replace(/\\(.)/g, function (m0, m1) m1 === "/" ? "/" : m0), + getSource: function regexp_getSource(re) re.source.replace(/\\(.)/g, function (m0, m1) m1 === "/" ? "/" : m0) }), maxErrors: 15,