| 98 | } |
| 99 | |
| 100 | void 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 | |
| 126 | bool FormatterPlugin::getAutoFormatOnSave() const { |
| 127 | return mAutoFormatOnSave; |
nothing calls this directly
no test coverage detected