From 805bc8f972a591614a38d8cda02e6751edb4b9cd Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Sat, 21 May 2022 00:21:31 +0200 Subject: [PATCH] Refresh spellcheck mode --- app/renderer/abr-document.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/renderer/abr-document.js b/app/renderer/abr-document.js index ab48ae8..62e8f7b 100644 --- a/app/renderer/abr-document.js +++ b/app/renderer/abr-document.js @@ -41,6 +41,8 @@ function AbrDocument () { this.misspelledWords = {}; this.spellcheckerWorker = cp.fork(__dirname + "/spellchecker-worker.js"); this.spellcheckerWorker.on("message", function(msg) { + if (!that.cm.getOption("mode", "abr-spellcheck-on")) return; + if (msg.misspelled) { var lang = that.spellcheckerLang; if (!lang) return; @@ -49,6 +51,9 @@ function AbrDocument () { } else if (that.misspelledWords[lang].indexOf(msg.misspelled) === -1) { that.misspelledWords[lang].push(msg.misspelled); } + + // Refresh spellcheck mode + that.cm.setOption("mode", "abr-spellcheck-on"); } });