editor: Add the abort command

- For now it only unsets the current selection.
This commit is contained in:
Andrew Hamilton 2022-01-13 13:25:00 +10:00
parent 3c1e34ca5e
commit 0497a8f7a9
2 changed files with 10 additions and 1 deletions

View file

@ -224,6 +224,12 @@ class EditorTestCase(unittest.TestCase):
self._assert_change(self.editor.undo, "a\nb", (0, 1))
self._assert_change(self.editor.undo, "ab", (1, 0))
def test_abort_command(self):
self._set_editor("", (0, 0))
self.editor.set_mark()
self.editor.abort_command()
self.assertEqual(self.editor.mark, None)
if __name__ == "__main__":
unittest.main()