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

Method createEditorWithTabWidget

src/eepp/ui/tools/uicodeeditorsplitter.cpp:731–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729}
730
731UITabWidget* UICodeEditorSplitter::createEditorWithTabWidget( Node* parent, bool openCurEditor ) {
732 eeASSERT( curWidgetExists() );
733 if ( nullptr == mBaseLayout )
734 mBaseLayout = parent;
735 UICodeEditor* prevCurEditor = mCurEditor;
736 UITabWidget* tabWidget = createTabWidget( parent );
737 auto editorData = createCodeEditorInTabWidget( tabWidget );
738 if ( editorData.first == nullptr || editorData.second == nullptr ) {
739 if ( !mTabWidgets.empty() && mTabWidgets[0]->getTabCount() > 0 ) {
740 editorData = createCodeEditorInTabWidget( mTabWidgets[0] );
741 } else {
742 Log::error( "Couldn't createCodeEditorInTabWidget in "
743 "UICodeEditorSplitter::createEditorWithTabWidget" );
744 return nullptr;
745 }
746 }
747 mAboutToAddEditor = editorData.second;
748 // Open same document in the new split
749 if ( openCurEditor && prevCurEditor && prevCurEditor != editorData.second &&
750 !prevCurEditor->getDocument().isEmpty() ) {
751 editorData.second->setDocument( prevCurEditor->getDocumentRef() );
752 editorData.second->goToLine( prevCurEditor->getDocument().getSelection().start() );
753 auto path( editorData.second->getDocument().getFilePath() );
754 if ( !path.empty() )
755 editorData.first->setTooltipText( path );
756 }
757 mAboutToAddEditor = nullptr;
758 return tabWidget;
759}
760
761UITab* UICodeEditorSplitter::isDocumentOpen( const std::string& path,
762 bool checkOnlyInCurrentTabWidget,

Callers 2

initMethod · 0.80
initMethod · 0.80

Calls 12

errorFunction · 0.85
getTabCountMethod · 0.80
getDocumentMethod · 0.80
getDocumentRefMethod · 0.80
getFilePathMethod · 0.80
setTooltipTextMethod · 0.80
emptyMethod · 0.45
isEmptyMethod · 0.45
setDocumentMethod · 0.45
goToLineMethod · 0.45
startMethod · 0.45
getSelectionMethod · 0.45

Tested by

no test coverage detected