macro_recorder: don't crash trying to move line out-of-bounds

main
Ilya Zhuravlev 2020-12-24 18:43:02 -05:00
parent 05483f6f03
commit f64a068f4b
1 changed files with 2 additions and 0 deletions

View File

@ -241,6 +241,8 @@ class MacroRecorder(BasicEditor):
if offset == 0:
return
index = self.lines.index(obj)
if index + offset < 0 or index + offset >= len(self.lines):
return
other = self.lines.index(self.lines[index + offset])
self.lines[index].remove()
self.lines[other].remove()