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

Method onUnregister

src/tools/ecode/plugins/formatter/formatterplugin.cpp:100–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100void FormatterPlugin::onUnregister( UICodeEditor* editor ) {
101 auto afIt = mIsAutoFormatting.find( &editor->getDocument() );
102 if ( afIt != mIsAutoFormatting.end() )
103 mIsAutoFormatting.erase( afIt );
104
105 auto cbs = mEditors[editor];
106 for ( auto listener : cbs )
107 editor->removeEventListener( listener );
108
109 if ( mShuttingDown )
110 return;
111 mEditors.erase( editor );
112 mEditorDocs.erase( editor );
113
114 TextDocument* doc = &editor->getDocument();
115 for ( auto editorIt : mEditorDocs )
116 if ( editorIt.second == doc )
117 return;
118
119 for ( auto& kb : mKeyBindings ) {
120 editor->getKeyBindings().removeCommandKeybind( kb.first );
121 if ( editor->hasDocument() )
122 editor->getDocument().removeCommand( kb.first );
123 }
124}
125
126bool FormatterPlugin::getAutoFormatOnSave() const {
127 return mAutoFormatOnSave;

Callers

nothing calls this directly

Calls 8

getDocumentMethod · 0.80
removeCommandKeybindMethod · 0.80
removeCommandMethod · 0.80
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
removeEventListenerMethod · 0.45
hasDocumentMethod · 0.45

Tested by

no test coverage detected