make new part opens not undo to an empty plate

This commit is contained in:
Lars Brubaker 2022-05-23 11:08:42 -07:00
parent d10975d0a9
commit 7154180e50

View file

@ -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)