diff --git a/include/eepp/ui/tools/uicodeeditorsplitter.hpp b/include/eepp/ui/tools/uicodeeditorsplitter.hpp index 6af8194c4..dcc9ec69e 100644 --- a/include/eepp/ui/tools/uicodeeditorsplitter.hpp +++ b/include/eepp/ui/tools/uicodeeditorsplitter.hpp @@ -107,7 +107,8 @@ class EE_API UICodeEditorSplitter { const std::string& path, std::shared_ptr pool, std::function onLoaded, UITabWidget* tabWidget ); - void removeUnusedTab( UITabWidget* tabWidget ); + void removeUnusedTab( UITabWidget* tabWidge, bool destroyOwnedNode = true, + bool immediateCloset = true ); UITabWidget* createEditorWithTabWidget( Node* parent, bool openCurEditor = true ); diff --git a/src/eepp/ui/tools/uicodeeditorsplitter.cpp b/src/eepp/ui/tools/uicodeeditorsplitter.cpp index 87bb92557..3491da143 100644 --- a/src/eepp/ui/tools/uicodeeditorsplitter.cpp +++ b/src/eepp/ui/tools/uicodeeditorsplitter.cpp @@ -459,7 +459,8 @@ UICodeEditorSplitter::createWidgetInTabWidget( UITabWidget* tabWidget, UIWidget* return std::make_pair( tab, widget ); } -void UICodeEditorSplitter::removeUnusedTab( UITabWidget* tabWidget ) { +void UICodeEditorSplitter::removeUnusedTab( UITabWidget* tabWidget, bool destroyOwnedNode, + bool immediateClose ) { if ( tabWidget && tabWidget->getTabCount() >= 2 && tabWidget->getTab( 0 )->getOwnedWidget()->isType( UI_TYPE_CODEEDITOR ) && tabWidget->getTab( 0 ) @@ -467,7 +468,7 @@ void UICodeEditorSplitter::removeUnusedTab( UITabWidget* tabWidget ) { ->asType() ->getDocument() .isEmpty() ) { - tabWidget->removeTab( (Uint32)0, true, true ); + tabWidget->removeTab( (Uint32)0, destroyOwnedNode, immediateClose ); } } diff --git a/src/tools/ecode/terminalmanager.cpp b/src/tools/ecode/terminalmanager.cpp index bf674a17f..5c81c4311 100644 --- a/src/tools/ecode/terminalmanager.cpp +++ b/src/tools/ecode/terminalmanager.cpp @@ -183,7 +183,7 @@ UITerminal* TerminalManager::createNewTerminal( const std::string& title, UITabW term->getTerm()->getTerminal()->setAllowMemoryTrimnming( true ); auto ret = mApp->getSplitter()->createWidgetInTabWidget( tabWidget, term, title.empty() ? mApp->i18n( "shell", "Shell" ).toUtf8() : title, true ); - mApp->getSplitter()->removeUnusedTab( tabWidget ); + mApp->getSplitter()->removeUnusedTab( tabWidget, true, false ); ret.first->setIcon( mApp->findIcon( "filetype-bash" ) ); term->setTitle( title ); auto csIt = mTerminalColorSchemes.find( mTerminalCurrentColorScheme );