mirror of
https://github.com/1j01/textual-paint.git
synced 2024-09-17 18:57:09 +03:00
Fix IndexError when undoing all the way
This commit is contained in:
parent
402b46c7df
commit
1a53a18912
@ -117,10 +117,10 @@ class PilotRecorder():
|
||||
self.steps_changed()
|
||||
elif isinstance(event, Key):
|
||||
if event.key == "ctrl+z" and self.steps:
|
||||
while isinstance(self.steps[-1][0], (MouseMove, MouseUp)):
|
||||
while self.steps and isinstance(self.steps[-1][0], (MouseMove, MouseUp)):
|
||||
self.steps.pop()
|
||||
self.steps.pop()
|
||||
while isinstance(self.steps[-1][0], MouseMove):
|
||||
while self.steps and isinstance(self.steps[-1][0], MouseMove):
|
||||
self.steps.pop()
|
||||
|
||||
self.steps_changed()
|
||||
|
Loading…
Reference in New Issue
Block a user