Fix undo for fill with module (which was caused by module add command not being undone properly in case of failure)

This commit is contained in:
DarkPhoenix
2020-04-20 16:36:16 +03:00
parent 98579c774b
commit f17cf9b736
4 changed files with 21 additions and 3 deletions

View File

@@ -1026,6 +1026,16 @@ class Fit:
if mod.isEmpty:
del self.modules[i]
def clearTail(self):
tailPositions = {}
for mod in reversed(self.modules):
if not mod.isEmpty:
break
tailPositions[self.modules.index(mod)] = mod.slot
for pos in reversed(tailPositions):
self.modules.remove(self.modules[pos])
return tailPositions
@property
def modCount(self):
x = 0