From 7154180e50c0fa1975a216e5451dac3a7ca4db3f Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Mon, 23 May 2022 11:08:42 -0700 Subject: [PATCH] make new part opens not undo to an empty plate --- MatterControlLib/ApplicationView/ApplicationController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 8b3c9f282..beaf71761 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -762,7 +762,12 @@ namespace MatterHackers.MatterControl await this.MainView.CreateNewDesignTab(false); var workspace = this.Workspaces.Last(); - workspace.SceneContext.AddToPlate(selectedLibraryItems); + var insertionGroup = workspace.SceneContext.AddToPlate(selectedLibraryItems); + + // wait for the insertion to finish + await insertionGroup.LoadingItemsTask; + // then clear the undo buffer so we don't ask to save and undoing does not remove the starting part + workspace.SceneContext.Scene.UndoBuffer.ClearHistory(); } internal void BlinkTab(ITab tab)