diff --git a/src/spellcheck/ontheflycheck.h b/src/spellcheck/ontheflycheck.h --- a/src/spellcheck/ontheflycheck.h +++ b/src/spellcheck/ontheflycheck.h @@ -68,6 +68,8 @@ void updateConfig(); void refreshSpellCheck(const KTextEditor::Range &range = KTextEditor::Range::invalid()); + void slotDocumentReloaded(const KTextEditor::Document *view = nullptr); + void updateInstalledMovingRanges(KTextEditor::ViewPrivate *view); protected: diff --git a/src/spellcheck/ontheflycheck.cpp b/src/spellcheck/ontheflycheck.cpp --- a/src/spellcheck/ontheflycheck.cpp +++ b/src/spellcheck/ontheflycheck.cpp @@ -72,6 +72,11 @@ connect(&document->buffer(), SIGNAL(respellCheckBlock(int,int)), this, SLOT(handleRespellCheckBlock(int,int))); + connect(document, &KTextEditor::Document::reloaded, + this, [this](KTextEditor::Document *doc) { + refreshSpellCheck(); + }); + // load the settings for the speller updateConfig();