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,9 @@ connect(&document->buffer(), SIGNAL(respellCheckBlock(int,int)), this, SLOT(handleRespellCheckBlock(int,int))); + connect(document, &KTextEditor::Document::reloaded, + this, &KateOnTheFlyChecker::slotDocumentReloaded); + // load the settings for the speller updateConfig(); @@ -689,6 +692,15 @@ } } +void KateOnTheFlyChecker::slotDocumentReloaded(const KTextEditor::Document *view) +{ + if (!view) { + return; + } + + refreshSpellCheck(); +} + void KateOnTheFlyChecker::addView(KTextEditor::Document *document, KTextEditor::View *view) { Q_ASSERT(document == m_document);