Go to a specific mark of the database. Returns the database to the state associated with the specified mark. Both the identifier of a mark and its name can be used. This method can only be called when the Undo/Redo mechanism has been enabled. Otherwise, an UndoRedoE
(self, mark: int | str)
| 2821 | # (self._curaction, self._curmark)) |
| 2822 | |
| 2823 | def goto(self, mark: int | str) -> None: |
| 2824 | """Go to a specific mark of the database. |
| 2825 | |
| 2826 | Returns the database to the state associated with the specified mark. |
| 2827 | Both the identifier of a mark and its name can be used. |
| 2828 | |
| 2829 | This method can only be called when the Undo/Redo mechanism has been |
| 2830 | enabled. Otherwise, an UndoRedoError is raised. |
| 2831 | |
| 2832 | """ |
| 2833 | self._check_open() |
| 2834 | self._check_undo_enabled() |
| 2835 | |
| 2836 | if mark == -1: # Special case |
| 2837 | mark = self._nmarks # Go beyond the mark bounds up to the end |
| 2838 | # Get the mark ID number |
| 2839 | markid = self._get_mark_id(mark) |
| 2840 | finalaction = self._get_final_action(markid) |
| 2841 | if finalaction < self._curaction: |
| 2842 | self.undo(mark) |
| 2843 | else: |
| 2844 | self.redo(mark) |
| 2845 | |
| 2846 | def get_current_mark(self) -> int: |
| 2847 | """Get the identifier of the current mark. |