The documentation says that for LuaUndoRedoStack::remove_undo_item(index), "The index of the undo item to remove, ordered from most recent to oldest."
However, testing shows that higher indexes remove more recent items and the index does not match the behavior of get_undo_item().
Reproduction:
- In a new save, place a steel chest and then a wooden chest.
- Hover over the undo button and see the wooden chest highlighted.
- Run "/c game.print(serpent.block(game.player.undo_redo_stack.get_undo_item(1)))" and see that information on the wooden chest is printed, as expected because it is the most recent item.
- Run "/c game.player.undo_redo_stack.remove_undo_item(2)", which in theory should remove the older item from the stack, the steel chest.
- Hover over the undo button and see the steel chest highlighted because the more recent wooden chest was removed from the stack instead.