mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-01 19:16:30 +03:00
In widgets rename all the addEventListener calls to on.
Some minor fixes in cpp, css, xml and html syntax highlighters.
This commit is contained in:
@@ -70,30 +70,27 @@ void FormatterPlugin::onRegister( UICodeEditor* editor ) {
|
||||
} );
|
||||
}
|
||||
|
||||
listeners.push_back(
|
||||
editor->addEventListener( Event::OnDocumentLoaded, [this, editor]( const Event* ) {
|
||||
tryRequestCapabilities( editor->getDocumentRef() );
|
||||
} ) );
|
||||
listeners.push_back( editor->on( Event::OnDocumentLoaded, [this, editor]( const Event* ) {
|
||||
tryRequestCapabilities( editor->getDocumentRef() );
|
||||
} ) );
|
||||
|
||||
listeners.push_back(
|
||||
editor->addEventListener( Event::OnDocumentChanged, [this, editor]( const Event* ) {
|
||||
TextDocument* newDoc = editor->getDocumentRef().get();
|
||||
mEditorDocs[editor] = newDoc;
|
||||
} ) );
|
||||
listeners.push_back( editor->on( Event::OnDocumentChanged, [this, editor]( const Event* ) {
|
||||
TextDocument* newDoc = editor->getDocumentRef().get();
|
||||
mEditorDocs[editor] = newDoc;
|
||||
} ) );
|
||||
|
||||
listeners.push_back(
|
||||
editor->addEventListener( Event::OnDocumentSave, [this]( const Event* event ) {
|
||||
if ( mAutoFormatOnSave && event->getNode()->isType( UI_TYPE_CODEEDITOR ) ) {
|
||||
UICodeEditor* editor = event->getNode()->asType<UICodeEditor>();
|
||||
auto isAutoFormatting = mIsAutoFormatting.find( &editor->getDocument() );
|
||||
if ( ( isAutoFormatting == mIsAutoFormatting.end() ||
|
||||
isAutoFormatting->second == false ) &&
|
||||
mPluginManager &&
|
||||
!String::startsWith( editor->getDocument().getFilePath(),
|
||||
mPluginManager->getPluginsPath() ) )
|
||||
formatDocAsync( editor );
|
||||
}
|
||||
} ) );
|
||||
listeners.push_back( editor->on( Event::OnDocumentSave, [this]( const Event* event ) {
|
||||
if ( mAutoFormatOnSave && event->getNode()->isType( UI_TYPE_CODEEDITOR ) ) {
|
||||
UICodeEditor* editor = event->getNode()->asType<UICodeEditor>();
|
||||
auto isAutoFormatting = mIsAutoFormatting.find( &editor->getDocument() );
|
||||
if ( ( isAutoFormatting == mIsAutoFormatting.end() ||
|
||||
isAutoFormatting->second == false ) &&
|
||||
mPluginManager &&
|
||||
!String::startsWith( editor->getDocument().getFilePath(),
|
||||
mPluginManager->getPluginsPath() ) )
|
||||
formatDocAsync( editor );
|
||||
}
|
||||
} ) );
|
||||
|
||||
mEditors.insert( { editor, listeners } );
|
||||
mEditorDocs[editor] = editor->getDocumentRef().get();
|
||||
|
||||
Reference in New Issue
Block a user