Added context menu on UICodeEditor.

This commit is contained in:
Martín Lucas Golini
2022-03-21 11:01:03 -03:00
parent 375d1e66e8
commit 1b3deaa7d4
16 changed files with 267 additions and 20 deletions

View File

@@ -1346,6 +1346,7 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) {
editor->setEnableColorPickerOnSelection( config.colorPickerSelection );
editor->setColorPreview( config.colorPreview );
editor->setFont( mFontMono );
editor->setMenuIconSize( mMenuIconSize );
doc.setAutoCloseBrackets( !mConfig.editor.autoCloseBrackets.empty() );
doc.setAutoCloseBracketsPairs( makeAutoClosePairs( mConfig.editor.autoCloseBrackets ) );
doc.setAutoDetectIndentType( config.autoDetectIndentType );
@@ -1456,6 +1457,10 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) {
ed->getKeyBindings().addKeybindsString( mKeybindings );
} );
}
if ( !editor->getDocument().hasSyntaxDefinition() ) {
editor->getDocument().resetSyntax();
editor->setSyntaxDefinition( editor->getDocument().getSyntaxDefinition() );
}
} );
editor->addEventListener(