mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
REPLines: Fix undo commands.
This commit is contained in:
1 parent
4cddd43f5a
commit
d9aea9eb3c
3 files changed
+29
-11
No files matched your search
@@ -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)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user