From 76ef74bc44e201562320906ca18d3add7084ff8b Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 27 Jul 2024 12:35:18 +1000 Subject: Feature [feature-requests:#1530]. SCI_SETCOPYSEPARATOR sets string to separate parts of multiple selection when copied. --- test/simpleTests.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/simpleTests.py b/test/simpleTests.py index 4f5b7251a..1ca5b76cb 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -1974,9 +1974,7 @@ class TestMultiSelection(unittest.TestCase): self.assertEqual(self.ed.Contents(), result) def testMultipleCopy(self): - self.ed.ClearAll() - t = b"abc\n123\nxyz" - self.ed.AddText(len(t), t) + self.ed.SetContents(b"abc\n123\nxyz") self.ed.SetSelection(4, 5) # 1 self.ed.AddSelection(1, 3) # bc self.ed.AddSelection(10, 11) # z @@ -1986,6 +1984,21 @@ class TestMultiSelection(unittest.TestCase): self.ed.Paste() self.assertEqual(self.ed.Contents(), b"1bcz") + def testCopySeparator(self): + self.assertEqual(self.ed.GetCopySeparator(), b"") + self.ed.CopySeparator = b"_" + self.assertEqual(self.ed.GetCopySeparator(), b"_") + self.ed.SetContents(b"abc\n123\nxyz") + self.ed.SetSelection(4, 5) # 1 + self.ed.AddSelection(1, 3) # bc + self.ed.AddSelection(10, 11) # z + self.ed.Copy() + self.ed.ClearAll() + self.ed.Paste() + # 1,bc,z separated by _ + self.assertEqual(self.ed.Contents(), b"1_bc_z") + self.ed.CopySeparator = b"" + def testPasteConversion(self): # Test that line ends are converted to current mode self.ed.SetSelection(0, 11) -- cgit v1.2.3