mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-26 17:25:46 +01:00
More finder tweaks.
This commit is contained in:
@@ -18,7 +18,8 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
let backwards = mode == modes.FIND_BACKWARD;
|
let backwards = mode == modes.FIND_BACKWARD;
|
||||||
commandline.open(backwards ? "?" : "/", "", mode);
|
commandline.open(backwards ? "?" : "/", "", mode);
|
||||||
|
|
||||||
this.rangeFind = null;
|
if (this.rangeFind)
|
||||||
|
this.rangeFind.reset();
|
||||||
this.find("", backwards);
|
this.find("", backwards);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -30,7 +31,6 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
let matchCase = !(options["ignorecase"] || options["smartcase"] && !/[A-Z]/.test(str));
|
let matchCase = !(options["ignorecase"] || options["smartcase"] && !/[A-Z]/.test(str));
|
||||||
let linksOnly = options["linksearch"];
|
let linksOnly = options["linksearch"];
|
||||||
|
|
||||||
// All this ado is ludicrous.
|
|
||||||
str = str.replace(/\\(.|$)/g, function (m, n1) {
|
str = str.replace(/\\(.|$)/g, function (m, n1) {
|
||||||
if (n1 == "l")
|
if (n1 == "l")
|
||||||
linksOnly = true;
|
linksOnly = true;
|
||||||
@@ -268,8 +268,6 @@ const RangeFind = Class("RangeFind", {
|
|||||||
|
|
||||||
this.highlighted = null;
|
this.highlighted = null;
|
||||||
this.lastString = "";
|
this.lastString = "";
|
||||||
this.forward = null;
|
|
||||||
this.found = false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get selectedRange() {
|
get selectedRange() {
|
||||||
@@ -283,6 +281,9 @@ const RangeFind = Class("RangeFind", {
|
|||||||
this.lastRange = this.selectedRange;
|
this.lastRange = this.selectedRange;
|
||||||
this.range = this.findRange(this.startRange);
|
this.range = this.findRange(this.startRange);
|
||||||
this.ranges.first = this.range;
|
this.ranges.first = this.range;
|
||||||
|
this.ranges.forEach(function (range) range.save());
|
||||||
|
this.forward = null;
|
||||||
|
this.found = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
sameDocument: function (r1, r2) r1 && r2 && r1.endContainer.ownerDocument == r2.endContainer.ownerDocument,
|
sameDocument: function (r1, r2) r1 && r2 && r1.endContainer.ownerDocument == r2.endContainer.ownerDocument,
|
||||||
|
|||||||
Reference in New Issue
Block a user