Fixes an issue when reloading documents (file system change) that disabled the linter by mistake.

This commit is contained in:
Martín Lucas Golini
2023-11-09 20:32:45 -03:00
parent 7f80638632
commit e9654631ea
7 changed files with 21 additions and 3 deletions

View File

@@ -572,9 +572,11 @@ void PluginBase::onRegister( UICodeEditor* editor ) {
std::vector<Uint32> listeners;
listeners.push_back(
editor->addEventListener( Event::OnDocumentLoaded, [this]( const Event* event ) {
editor->addEventListener( Event::OnDocumentLoaded, [this, editor]( const Event* event ) {
Lock l( mMutex );
const DocEvent* docEvent = static_cast<const DocEvent*>( event );
mDocs.insert( docEvent->getDoc() );
mEditorDocs[editor] = docEvent->getDoc();
onDocumentLoaded( docEvent->getDoc() );
} ) );
@@ -596,6 +598,7 @@ void PluginBase::onRegister( UICodeEditor* editor ) {
TextDocument* newDoc = editor->getDocumentRef().get();
Lock l( mMutex );
mDocs.erase( oldDoc );
mDocs.insert( newDoc );
mEditorDocs[editor] = newDoc;
onDocumentChanged( editor, oldDoc );
} ) );