Skip to content

Commit

Permalink
Refresh spellcheck mode
Browse files Browse the repository at this point in the history
  • Loading branch information
brrd committed May 20, 2022
1 parent e53c1af commit 805bc8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/renderer/abr-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
}
});

Expand Down

0 comments on commit 805bc8f

Please sign in to comment.