clean up Drawing.before after creating undo event

This isn't a bug here, but it led to a bug in lines 2.
This commit is contained in:
Kartik K. Agaram 2024-08-31 18:34:03 -07:00
parent a8158f9717
commit 5c8e3e96c8
2 changed files with 2 additions and 0 deletions

View File

@ -184,6 +184,7 @@ function edit.draw(State)
State.cursor1.line = State.cursor1.line+1
end
record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})
Drawing.before = nil
schedule_save(State)
end,
})

View File

@ -190,6 +190,7 @@ function edit.draw(State, hide_cursor, show_line_numbers)
State.cursor1.line = State.cursor1.line+1
end
record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})
Drawing.before = nil
schedule_save(State)
end,
})