From 8292be92d8958fc09dceb7c6bf252ac1c170ed1a Mon Sep 17 00:00:00 2001 From: siikamiika Date: Thu, 16 Jan 2020 23:22:38 +0200 Subject: use TextScanner in QueryParser --- ext/mixed/js/text-scanner.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/mixed/js/text-scanner.js') diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index a05dd2ee..e037109d 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) { -- cgit v1.2.3 From 54a48a7a9ba33fa07b3acaa775f3d1c384172dbd Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 25 Jan 2020 11:17:39 -0500 Subject: Ensure textSource is cleaned up if it isn't used --- ext/mixed/js/text-scanner.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/mixed/js/text-scanner.js') diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index e037109d..88f1e27a 100644 --- a/ext/mixed/js/text-scanner.js +++ b/ext/mixed/js/text-scanner.js @@ -299,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) { -- cgit v1.2.3