Fix changing the parser not immediately updating (#1358)

This commit is contained in:
toasted-nutbread 2021-02-08 17:53:17 -05:00 committed by GitHub
parent 69e8addb47
commit e386599872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {