Example #1
0
    def test_scintillawrapper_void_int_position(self):
        editor.write('abc123 def456 ghi789 jk12 lmnop3456')
        editor.setSel(7, 13)
        editor.addSelection(14, 20)
        editor.setSelectionNCaret(1, 16)
        editor.setSelectionNAnchor(1, 18)
        # Note: Do not attempt to call setSelectionNCaret on a selection that doesn't exist - it causes a crash.
        # Always call addSelection first
        caret = editor.getSelectionNCaret(1)
        anchor = editor.getSelectionNAnchor(1)

        self.assertEqual(caret, 16)
        self.assertEqual(anchor, 18)
Example #2
0
 def callback_scintillawrapper_int_void_stringresult(self, args):
     editor.clearCallbacks()
     editor.setSel(7, 13)
     text = editor.getSelText()
     self.assertEqual(text, 'def456')
     self.callbackCalled = True
Example #3
0
 def test_scintillawrapper_int_void_stringresult(self):
     editor.write('abc123 def456 ghi789')
     editor.setSel(7, 13)
     text = editor.getSelText()
     self.assertEqual(text, 'def456')