ecode: Improved "Open with ecode" on macOS.

This commit is contained in:
Martín Lucas Golini
2023-07-23 20:07:44 -03:00
parent 0dc779ccb3
commit 451ffc75ad
2 changed files with 1320 additions and 2 deletions

View File

@@ -600,9 +600,14 @@ void App::onFileDropped( String file ) {
}
}
loadFileFromPath( file, false, codeEditor, [tab]( UICodeEditor*, const std::string& ) {
loadFileFromPath( file, false, codeEditor, [this, tab]( UICodeEditor* editor, const std::string& ) {
if ( tab )
tab->getTabWidget()->setTabSelected( tab );
tab->setTabSelected();
else {
UITab* tab = mSplitter->tabFromEditor( editor );
if ( tab )
tab->setTabSelected();
}
} );
}
@@ -1636,6 +1641,8 @@ void App::loadFileDelayed() {
editor->runOnMainThread( [this, editor, fileAndPos] {
editor->goToLine( fileAndPos.second );
mSplitter->addEditorPositionToNavigationHistory( editor );
UITab* tab = mSplitter->tabFromEditor( editor );
if (tab) tab->setTabSelected();
} );
} );
}