Still more WIP

This commit is contained in:
Martín Lucas Golini
2025-01-03 22:01:16 -03:00
parent a96e033b81
commit c4bd88461d
10 changed files with 251 additions and 113 deletions

View File

@@ -195,4 +195,21 @@ void PluginBase::onUnregister( UICodeEditor* editor ) {
mDocs.erase( doc );
}
void PluginBase::onBeforeUnregister( UICodeEditor* editor ) {
for ( auto& kb : mKeyBindings )
editor->getKeyBindings().removeCommandKeybind( kb.first );
}
void PluginBase::onRegisterEditor( UICodeEditor* editor ) {
for ( auto& kb : mKeyBindings ) {
if ( !kb.second.empty() )
editor->getKeyBindings().addKeybindString( kb.second, kb.first );
}
}
void PluginBase::onUnregisterDocument( TextDocument* doc ) {
for ( auto& kb : mKeyBindings )
doc->removeCommand( kb.first );
}
} // namespace ecode