remove undo action after tree reset (eg. after import)

This commit is contained in:
michael starke
2017-10-25 11:14:40 +02:00
parent 73149dd125
commit 4f98584a2e

View File

@@ -534,6 +534,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
- (void)setTree:(KPKTree *)tree { - (void)setTree:(KPKTree *)tree {
if(self.tree != tree) { if(self.tree != tree) {
/* reseting the tree make undo a bit useless */
[self.undoManager removeAllActions];
_tree = tree; _tree = tree;
if(nil == self.treeDelegate) { if(nil == self.treeDelegate) {
self.treeDelegate = [[MPTreeDelegate alloc] initWithDocument:self]; self.treeDelegate = [[MPTreeDelegate alloc] initWithDocument:self];