REPLines: Fix undo commands.

This commit is contained in:
parouby committed 2025-09-18 09:54:35 +02:00
1 parent 4cddd43f5a
commit d9aea9eb3c
3 files changed
+29 -11

No files matched your search

+6 -3
View File
@@ -83,7 +83,7 @@ class PamhyrModelList(SQLSubModel):
return self.lst.index(el)
def get(self, index):
if len(self._lst) == 0:
if len(self.lst) <= index :
return None
return self.lst[index]
@@ -122,7 +122,10 @@ class PamhyrModelList(SQLSubModel):
raise NotImplementedMethodeError(self, self.new)
def insert(self, index, new):
self._lst.insert(index, new)
if new in self._lst:
new.set_as_not_deleted()
else:
self._lst.insert(index, new)
if self._status is not None:
self._status.modified()
@@ -165,7 +168,7 @@ class PamhyrModelList(SQLSubModel):
lambda x: x[1],
filter(
lambda x: x[0] in indexes,
enumerate(self.lst)
enumerate(self._lst)
)
)
)