MCPcopy Create free account
hub / github.com/SpartanJ/eepp / onRegister

Method onRegister

src/tools/ecode/plugins/git/gitplugin.cpp:1229–1252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227// Stash operations
1228
1229void GitPlugin::onRegister( UICodeEditor* editor ) {
1230 PluginBase::onRegister( editor );
1231
1232 for ( auto& kb : mKeyBindings ) {
1233 if ( !kb.second.empty() )
1234 editor->getKeyBindings().addKeybindString( kb.second, kb.first );
1235 }
1236
1237 if ( !editor->hasDocument() )
1238 return;
1239
1240 auto& doc = editor->getDocument();
1241 doc.setCommand( "git-blame", [this]( TextDocument::Client* client ) {
1242 blame( static_cast<UICodeEditor*>( client ) );
1243 } );
1244 doc.setCommand( "show-source-control-tab", [this]() {
1245 if ( mTab )
1246 mTab->setTabSelected();
1247 } );
1248 doc.setCommand( "git-pull", [this] { pull( projectPath() ); } );
1249 doc.setCommand( "git-push", [this] { push( projectPath() ); } );
1250 doc.setCommand( "git-fetch", [this] { fetch( projectPath() ); } );
1251 doc.setCommand( "git-commit", [this] { commit( projectPath() ); } );
1252}
1253
1254void GitPlugin::onUnregister( UICodeEditor* editor ) {
1255 PluginBase::onUnregister( editor );

Callers

nothing calls this directly

Calls 7

commitFunction · 0.85
addKeybindStringMethod · 0.80
getDocumentMethod · 0.80
emptyMethod · 0.45
hasDocumentMethod · 0.45
setCommandMethod · 0.45
setTabSelectedMethod · 0.45

Tested by

no test coverage detected