mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 13:25:45 +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() {
|
this._statusTimer = Timer(5, 100, function statusTell() {
|
||||||
if (self._completions == null || self._completions.selected == null)
|
if (self._completions == null || self._completions.selected == null)
|
||||||
statusline.progess = "";
|
statusline.progress = "";
|
||||||
else
|
else
|
||||||
statusline.progress = "match " + (self._completions.selected + 1) + " of " + self._completions.items.length;
|
statusline.progress = "match " + (self._completions.selected + 1) + " of " + self._completions.items.length;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
const RangeFind = Class("RangeFind", {
|
const RangeFind = Class("RangeFind", {
|
||||||
init: function (matchCase, backward, elementPath, regexp) {
|
init: function (matchCase, backward, elementPath, regexp) {
|
||||||
this.window = Cu.getWeakReference(window);
|
this.window = Cu.getWeakReference(window);
|
||||||
|
this.baseDocument = Cu.getWeakReference(content.document);
|
||||||
this.elementPath = elementPath || null;
|
this.elementPath = elementPath || null;
|
||||||
this.reverse = Boolean(backward);
|
this.reverse = Boolean(backward);
|
||||||
|
|
||||||
@@ -576,6 +577,9 @@ const RangeFind = Class("RangeFind", {
|
|||||||
return range;
|
return range;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get stale() this._stale || this.baseDocument.get() != content.document,
|
||||||
|
set stale(val) this._stale = val,
|
||||||
|
|
||||||
addListeners: function () {
|
addListeners: function () {
|
||||||
for (let range in array.iterValues(this.ranges))
|
for (let range in array.iterValues(this.ranges))
|
||||||
range.window.addEventListener("unload", this.closure.onUnload, true);
|
range.window.addEventListener("unload", this.closure.onUnload, true);
|
||||||
@@ -683,8 +687,7 @@ const RangeFind = Class("RangeFind", {
|
|||||||
return range;
|
return range;
|
||||||
},
|
},
|
||||||
sameDocument: function (r1, r2) r1 && r2 && r1.endContainer.ownerDocument == r2.endContainer.ownerDocument,
|
sameDocument: function (r1, r2) r1 && r2 && r1.endContainer.ownerDocument == r2.endContainer.ownerDocument,
|
||||||
selectNodePath: ["a", "xhtml:a", "*[@onclick]"].map(
|
selectNodePath: ["a", "xhtml:a", "*[@onclick]"].map(function (p) "ancestor-or-self::" + p).join(" | ")
|
||||||
function (p) "ancestor-or-self::" + p).join(" | ")
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ const Styles = Module("Styles", {
|
|||||||
bang: true,
|
bang: true,
|
||||||
literalArg: sty.css,
|
literalArg: sty.css,
|
||||||
options: sty.name ? { "-name": sty.name } : {}
|
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