Single instance support (tested in Linux and Windows, pending the rest of the OSes, issue SpartanJ/ecode#58).

Refresh buttons state when Clear Menu is used (issue SpartanJ/ecode#339).
This commit is contained in:
Martín Lucas Golini
2024-09-28 01:01:14 -03:00
parent 63cc931dec
commit 49e56f05a2
16 changed files with 551 additions and 112 deletions

View File

@@ -251,25 +251,27 @@ LSPClientPlugin::~LSPClientPlugin() {
mShuttingDown = true;
mManager->unsubscribeMessages( this );
unsubscribeFileSystemListener();
Lock l( mDocMutex );
for ( const auto& editor : mEditors ) {
for ( auto& kb : mKeyBindings ) {
editor.first->getKeyBindings().removeCommandKeybind( kb.first );
if ( editor.first->hasDocument() )
editor.first->getDocument().removeCommand( kb.first );
{
Lock l( mDocMutex );
for ( const auto& editor : mEditors ) {
for ( auto& kb : mKeyBindings ) {
editor.first->getKeyBindings().removeCommandKeybind( kb.first );
if ( editor.first->hasDocument() )
editor.first->getDocument().removeCommand( kb.first );
}
for ( auto listener : editor.second )
editor.first->removeEventListener( listener );
if ( mBreadcrumb )
editor.first->unregisterTopSpace( this );
editor.first->unregisterPlugin( this );
}
for ( auto listener : editor.second )
editor.first->removeEventListener( listener );
if ( mBreadcrumb )
editor.first->unregisterTopSpace( this );
editor.first->unregisterPlugin( this );
}
if ( nullptr == mManager->getSplitter() )
return;
for ( const auto& editor : mEditorsTags ) {
if ( mManager->getSplitter()->editorExists( editor.first ) ) {
for ( const auto& tag : editor.second )
editor.first->removeActionsByTag( tag );
if ( nullptr == mManager->getSplitter() )
return;
for ( const auto& editor : mEditorsTags ) {
if ( mManager->getSplitter()->editorExists( editor.first ) ) {
for ( const auto& tag : editor.second )
editor.first->removeActionsByTag( tag );
}
}
}
}