Example #1
0
 def test_scintillawrapper_void_position_void(self):
     editor.write('Hello world 12356')
     editor.gotoPos(6)
     afterGotoPos = editor.getCurrentPos()
     editor.setCurrentPos(10)
     afterSetCurrentPos = editor.getCurrentPos()
     self.assertEqual(afterGotoPos, 6)
     self.assertEqual(afterSetCurrentPos, 10)
Example #2
0
 def document_range_formatting_handler(self, decoded_message):
     log(decoded_message)
     editor.beginUndoAction()
     current_caret_pos = editor.getCurrentPos()
     for item in reversed(decoded_message['result']):
         self.__format_document(item)
     editor.gotoPos(current_caret_pos)
     editor.endUndoAction()
Example #3
0
 def callback_scintillawrapper_int_int_stringresult_getCurLine(self, args):
     editor.gotoPos(6)
     line = editor.getCurLine()
     self.assertEqual(line, 'Two\r\n')
     self.callbackCalled = True
Example #4
0
 def test_scintillawrapper_int_int_stringresult_getCurLine(self):
     editor.write('One\r\nTwo\r\nThree\r\n')
     editor.gotoPos(6)
     line = editor.getCurLine()
     self.assertEqual(line, 'Two\r\n')
Example #5
0
 def test_scintillawrapper_void_int_string(self):
     editor.setText('abc123')
     editor.gotoPos(3)
     editor.addText('def')
     resultText = editor.getText()
     self.assertEqual(resultText, 'abcdef123')