Minor fixes in Code Editor.

Fixed old typo (collumn -> column).
This commit is contained in:
Martín Lucas Golini
2020-07-04 01:34:37 -03:00
parent 16f58f2018
commit 2116c93494
10 changed files with 102 additions and 90 deletions

View File

@@ -79,7 +79,8 @@ void App::openFileDialog() {
event->getNode()->asType<UIFileDialog>()->getFullPath() );
} );
dialog->addEventListener( Event::OnWindowClose, [&]( const Event* ) {
if ( mEditorSplitter->getCurEditor() && !SceneManager::instance()->isShootingDown() )
if ( mEditorSplitter && mEditorSplitter->getCurEditor() &&
!SceneManager::instance()->isShootingDown() )
mEditorSplitter->getCurEditor()->setFocus();
} );
dialog->center();
@@ -948,7 +949,7 @@ void App::updateDocumentMenu() {
mDocMenu->find( "line_endings" )
->asType<UIMenuSubMenu>()
->getSubMenu()
->find( mConfig.editor.windowsLineEndings ? "windows" : "unix" )
->find( doc.getLineEnding() == TextDocument::LineEnding::CRLF ? "windows" : "unix" )
->asType<UIMenuRadioButton>()
->setActive( true );
@@ -1015,6 +1016,8 @@ void App::updateDocInfo( TextDocument& doc ) {
void App::onCodeEditorFocusChange( UICodeEditor* editor ) {
updateDocInfo( editor->getDocument() );
updateDocumentMenu();
if ( mSearchState.editor && mSearchState.editor != editor ) {
String word = mSearchState.editor->getHighlightWord();
mSearchState.editor->setHighlightWord( "" );
@@ -1045,6 +1048,10 @@ void App::onDocumentLoaded( UICodeEditor* codeEditor, const std::string& path )
if ( mRecentFiles.size() > 10 )
mRecentFiles.resize( 10 );
updateRecentFiles();
if ( mEditorSplitter->getCurEditor() == codeEditor ) {
updateDocumentMenu();
updateDocInfo( codeEditor->getDocument() );
}
}
const CodeEditorConfig& App::getCodeEditorConfig() const {