summaryrefslogtreecommitdiff
path: root/ext/mixed/js/text-scanner.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2020-01-26 11:29:30 -0800
committerAlex Yatskov <alex@foosoft.net>2020-01-26 11:29:30 -0800
commit0c5b9b1fa1599cbf769d96cdebc226310f9dd8bc (patch)
treee734e2c3005078dbc248b541d357a934baa8a116 /ext/mixed/js/text-scanner.js
parent2a12036ca305044291f1f4105d6a8d249848b210 (diff)
parent0cf1cf3aa094585bd6db8db2c1f229ba0ea37b6e (diff)
Merge branch 'master' into testing
Diffstat (limited to 'ext/mixed/js/text-scanner.js')
-rw-r--r--ext/mixed/js/text-scanner.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index a05dd2ee..88f1e27a 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -281,6 +281,7 @@ class TextScanner {
setOptions(options) {
this.options = options;
+ this.setEnabled(this.options.general.enable);
}
async searchAt(x, y, cause) {
@@ -298,11 +299,11 @@ class TextScanner {
}
const textSource = docRangeFromPoint(x, y, this.options.scanning.deepDomScan);
- if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
- return;
- }
-
try {
+ if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
+ return;
+ }
+
this.pendingLookup = true;
const result = await this.onSearchSource(textSource, cause);
if (result !== null) {