mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-09 01:14:11 +01:00
Fix some marks issues. Always scroll to the [count]th line rather than the [count]th percent with n_G.
This commit is contained in:
@@ -372,6 +372,10 @@ var DOM = Class("DOM", {
|
||||
*/
|
||||
get style() {
|
||||
let node = this[0];
|
||||
if (node instanceof Ci.nsIDOMWindow)
|
||||
node = node.document;
|
||||
if (node instanceof Ci.nsIDOMDocument)
|
||||
node = node.documentElement;
|
||||
while (node && !(node instanceof Ci.nsIDOMElement) && node.parentNode)
|
||||
node = node.parentNode;
|
||||
|
||||
@@ -462,6 +466,8 @@ var DOM = Class("DOM", {
|
||||
*/
|
||||
get xpath() {
|
||||
function quote(val) "'" + val.replace(/[\\']/g, "\\$&") + "'";
|
||||
if (!this[0] instanceof Ci.nsIDOMElement)
|
||||
return null;
|
||||
|
||||
let res = [];
|
||||
let doc = this.document;
|
||||
|
||||
@@ -484,10 +484,11 @@ var RangeFind = Class("RangeFind", {
|
||||
let saved = ["lastRange", "lastString", "range", "regexp"].map(function (s) [s, this[s]], this);
|
||||
let res;
|
||||
try {
|
||||
let regexp = this.regexp && word != util.regexp.escape(word);
|
||||
this.lastRange = null;
|
||||
if (this.regexp) {
|
||||
this.regexp = false;
|
||||
if (regexp) {
|
||||
let re = RegExp(word, "gm" + this.flags);
|
||||
this.regexp = false;
|
||||
for (this.range in array.iterValues(this.ranges)) {
|
||||
for (let match in util.regexp.iterate(re, DOM.stringify(this.range.range, true))) {
|
||||
let lastRange = this.lastRange;
|
||||
@@ -635,8 +636,9 @@ var RangeFind = Class("RangeFind", {
|
||||
}
|
||||
|
||||
let word = pattern;
|
||||
let regexp = this.regexp && word != util.regexp.escape(word);
|
||||
|
||||
if (this.regexp)
|
||||
if (regexp)
|
||||
try {
|
||||
RegExp(pattern);
|
||||
}
|
||||
@@ -661,7 +663,7 @@ var RangeFind = Class("RangeFind", {
|
||||
if (this.backward && !again)
|
||||
start = RangeFind.endpoint(this.startRange, false);
|
||||
|
||||
if (this.regexp) {
|
||||
if (regexp) {
|
||||
let range = this.range.range.cloneRange();
|
||||
range[this.backward ? "setEnd" : "setStart"](
|
||||
start.startContainer, start.startOffset);
|
||||
|
||||
Reference in New Issue
Block a user