Skip to content

Commit 9d80c00

Browse files
sowicmsowicm
authored andcommitted
New Tab on Start
1 parent c3f9504 commit 9d80c00

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

LiteEditor/frame.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,10 @@ void clMainFrame::Bootstrap()
17401740
wxCommandEvent loadSessionEvent(wxEVT_LOAD_SESSION);
17411741
EventNotifier::Get()->AddPendingEvent(loadSessionEvent);
17421742
}
1743+
else
1744+
{
1745+
GetMainBook()->NewEditor();
1746+
}
17431747
}
17441748

17451749
void clMainFrame::UpdateBuildTools() {}
@@ -1970,6 +1974,10 @@ void clMainFrame::LoadSession(const wxString& sessionName)
19701974
GetMainBook()->RestoreSession(session);
19711975
}
19721976
}
1977+
else
1978+
{
1979+
GetMainBook()->NewEditor();
1980+
}
19731981
}
19741982

19751983
void clMainFrame::OnSave(wxCommandEvent& event)

LiteEditor/mainbook.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ void MainBook::SaveSession(SessionEntry& session, wxArrayInt* excludeArr) { Crea
295295

296296
void MainBook::RestoreSession(SessionEntry& session)
297297
{
298-
if(session.GetTabInfoArr().empty()) return; // nothing to restore
298+
if(session.GetTabInfoArr().empty())
299+
{
300+
NewEditor();
301+
return;
302+
}
299303

300304
CloseAll(false);
301305
size_t sel = session.GetSelectedTab();

0 commit comments

Comments
 (0)