| 1467 | } |
| 1468 | |
| 1469 | void 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 | |
| 1491 | void App::createPluginManagerUI() { |
| 1492 | UIPluginManager::New( mUISceneNode, mPluginManager.get(), [this]( const std::string& path ) { |
no test coverage detected