mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-04 17:35:46 +01:00
Fix RangeFind corner case.
This commit is contained in:
@@ -258,7 +258,7 @@ const CommandLine = Module("commandline", {
|
||||
|
||||
this._statusTimer = Timer(5, 100, function statusTell() {
|
||||
if (self._completions == null || self._completions.selected == null)
|
||||
statusline.progess = "";
|
||||
statusline.progress = "";
|
||||
else
|
||||
statusline.progress = "match " + (self._completions.selected + 1) + " of " + self._completions.items.length;
|
||||
});
|
||||
|
||||
@@ -261,6 +261,7 @@ const RangeFinder = Module("rangefinder", {
|
||||
const RangeFind = Class("RangeFind", {
|
||||
init: function (matchCase, backward, elementPath, regexp) {
|
||||
this.window = Cu.getWeakReference(window);
|
||||
this.baseDocument = Cu.getWeakReference(content.document);
|
||||
this.elementPath = elementPath || null;
|
||||
this.reverse = Boolean(backward);
|
||||
|
||||
@@ -576,6 +577,9 @@ const RangeFind = Class("RangeFind", {
|
||||
return range;
|
||||
},
|
||||
|
||||
get stale() this._stale || this.baseDocument.get() != content.document,
|
||||
set stale(val) this._stale = val,
|
||||
|
||||
addListeners: function () {
|
||||
for (let range in array.iterValues(this.ranges))
|
||||
range.window.addEventListener("unload", this.closure.onUnload, true);
|
||||
@@ -683,8 +687,7 @@ const RangeFind = Class("RangeFind", {
|
||||
return range;
|
||||
},
|
||||
sameDocument: function (r1, r2) r1 && r2 && r1.endContainer.ownerDocument == r2.endContainer.ownerDocument,
|
||||
selectNodePath: ["a", "xhtml:a", "*[@onclick]"].map(
|
||||
function (p) "ancestor-or-self::" + p).join(" | ")
|
||||
selectNodePath: ["a", "xhtml:a", "*[@onclick]"].map(function (p) "ancestor-or-self::" + p).join(" | ")
|
||||
});
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
|
||||
@@ -385,7 +385,7 @@ const Styles = Module("Styles", {
|
||||
bang: true,
|
||||
literalArg: sty.css,
|
||||
options: sty.name ? { "-name": sty.name } : {}
|
||||
} for ([k, sty] in Iterator(styles.userSheets))
|
||||
} for ([k, sty] in Iterator(styles.userSheets.slice().sort(function (a, b) String.localeCompare(a.name || "", b.name || ""))))
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user