From e386599872ed4549b9279fe8386cd902eb96d5fe Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 8 Feb 2021 17:53:17 -0500 Subject: Fix changing the parser not immediately updating (#1358) --- ext/bg/js/query-parser.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/bg/js/query-parser.js b/ext/bg/js/query-parser.js index ea215582..05ebfa27 100644 --- a/ext/bg/js/query-parser.js +++ b/ext/bg/js/query-parser.js @@ -53,7 +53,9 @@ class QueryParser extends EventDispatcher { } setOptions({selectedParser, termSpacing, scanning}) { + let selectedParserChanged = false; if (selectedParser === null || typeof selectedParser === 'string') { + selectedParserChanged = (this._selectedParser !== selectedParser); this._selectedParser = selectedParser; } if (typeof termSpacing === 'boolean') { @@ -63,6 +65,9 @@ class QueryParser extends EventDispatcher { this._textScanner.setOptions(scanning); } this._textScanner.setEnabled(true); + if (selectedParserChanged && this._parseResults.length > 0) { + this._renderParseResult(); + } } async setText(text) { -- cgit v1.2.3