From bd97e46bc614bb86ff18ab493240dc9be2dabd05 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Wed, 29 Oct 2025 17:10:25 +1100 Subject: Feature [feature-requests:#1567]. Fix bug when indenting rectangular selection. --- test/simpleTests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/simpleTests.py') diff --git a/test/simpleTests.py b/test/simpleTests.py index 0389d6dbc..020b72e99 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -312,6 +312,24 @@ class TestSimple(unittest.TestCase): self.assertEqual(self.ed.Contents(), b"\tx\tb") self.assertEqual(self.ed.GetLineIndentPosition(0), 1) + def testRectangularIndent(self): + self.ed.VirtualSpaceOptions = 3 + self.ed.AddText(3, b"\n\n\n") + self.ed.RectangularSelectionAnchor = 2 + self.ed.RectangularSelectionCaret = 0 + self.ed.TabIndents = 0 + self.ed.UseTabs = 1 + self.ed.Tab() + self.assertEqual(self.ed.Contents(), b"\t\n\t\n\t\n") + self.assertEqual(self.ed.GetSelectionSerialized(), b'T#2,5-1') + self.assertEqual(self.ed.GetSelectionNAnchor(0), 5) + self.assertEqual(self.ed.GetSelectionNCaret(0), 5) + self.assertEqual(self.ed.GetSelectionNAnchor(1), 3) + self.assertEqual(self.ed.GetSelectionNCaret(1), 3) + self.assertEqual(self.ed.GetSelectionNAnchor(2), 1) + self.assertEqual(self.ed.GetSelectionNCaret(2), 1) + self.ed.VirtualSpaceOptions = 0 + def testGetCurLine(self): self.ed.AddText(1, b"x") data = ctypes.create_string_buffer(b"\0" * 100) -- cgit v1.2.3