MCPcopy Create free account
hub / github.com/SpartanJ/eepp / focusOrLoadFile

Method focusOrLoadFile

src/tools/ecode/ecode.cpp:1469–1489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467}
1468
1469void App::focusOrLoadFile( const std::string& path, const TextRange& range,
1470 bool searchInSameContext ) {
1471 UITab* tab = mSplitter->isDocumentOpen( path, searchInSameContext );
1472 if ( !tab ) {
1473 FileInfo fileInfo( path );
1474 if ( fileInfo.exists() && fileInfo.isRegularFile() )
1475 loadFileFromPath( path, true, nullptr, [this, range]( UICodeEditor* editor, auto ) {
1476 if ( range.isValid() ) {
1477 editor->goToLine( range.start() );
1478 mSplitter->addEditorPositionToNavigationHistory( editor );
1479 }
1480 } );
1481 } else {
1482 tab->getTabWidget()->setTabSelected( tab );
1483 if ( range.isValid() ) {
1484 UICodeEditor* editor = tab->getOwnedWidget()->asType<UICodeEditor>();
1485 editor->goToLine( range.start() );
1486 mSplitter->addEditorPositionToNavigationHistory( editor );
1487 }
1488 }
1489}
1490
1491void App::createPluginManagerUI() {
1492 UIPluginManager::New( mUISceneNode, mPluginManager.get(), [this]( const std::string& path ) {

Callers 4

initLocateBarMethod · 0.80
buildStatusBarMethod · 0.80
changeScopeMethod · 0.80
LLMChatUIMethod · 0.80

Calls 10

isDocumentOpenMethod · 0.80
isRegularFileMethod · 0.80
getOwnedWidgetMethod · 0.80
existsMethod · 0.45
isValidMethod · 0.45
goToLineMethod · 0.45
startMethod · 0.45
setTabSelectedMethod · 0.45
getTabWidgetMethod · 0.45

Tested by

no test coverage detected