예제 #1
0
 def callback_scintillawrapper_position_void_void(self, args):
     if args["modificationType"] & MODIFICATIONFLAGS.INSERTTEXT == 0:   # Ignore anything that isn't INSERTTEXT
         return
     editor.clearCallbacks()
     editor.write("1234")
     position = editor.getCurrentPos()
     self.assertEqual(position, 8)  # test1234|
     self.callbackCalled = True
예제 #2
0
 def callback_scintillawrapper_int_position_void(self, args):
     editor.clearCallbacks()
     editor.setText('')
     self.test_scintillawrapper_int_position_void_getColumn()
     editor.setText('')
     self.test_scintillawrapper_int_position_void_getCharAt()
     editor.setText('')
     self.test_scintillawrapper_int_position_void_lineFromPosition()
     self.callbackCalled = True
예제 #3
0
    def terminate(self):
        log('clear callbacks...')
        notepad.clearCallbacks([
            NOTIFICATION.BUFFERACTIVATED, NOTIFICATION.FILESAVED,
            NOTIFICATION.FILECLOSED
        ])
        editor.clearCallbacks([
            SCINTILLANOTIFICATION.CHARADDED, SCINTILLANOTIFICATION.DWELLEND,
            SCINTILLANOTIFICATION.DWELLSTART
        ])

        for monitor_thread in self.com_manager.running_monitoring_threads():
            self.com_manager.stop_monitoring_thread(monitor_thread)
            self.com_manager.send(self.lsp_msg.exit())
            self.com_manager.send(self.lsp_msg.shutdown())
예제 #4
0
 def clearCallbacks(self):
     editor.clearCallbacks([Npp.SCINTILLANOTIFICATION.CALLTIPCLICK])
     editor.clearCallbacks([Npp.SCINTILLANOTIFICATION.CHARADDED])
     editor.clearCallbacks([Npp.SCINTILLANOTIFICATION.DWELLSTART])
     editor.clearCallbacks([Npp.SCINTILLANOTIFICATION.MODIFIED])
     notepad.clearCallbacks([Npp.NOTIFICATION.BUFFERACTIVATED])
     notepad.clearCallbacks([Npp.NOTIFICATION.SHUTDOWN])
     if self.lexer:
         notepad.clearCallbacks([Npp.SCINTILLANOTIFICATION.UPDATEUI])
         notepad.clearCallbacks([Npp.NOTIFICATION.LANGCHANGED])
예제 #5
0
def stop_regex_tester():
    editor.clearCallbacks([SCINTILLANOTIFICATION.UPDATEUI])
    notepad.clearCallbacks([NOTIFICATION.FILEBEFORECLOSE])

    notepad.activateBufferID(REGEX_TESTER_INPUT_TAB)

    if regex_tester_doc_is_current_doc():
        editor2.replace('RegexTester isActive', 'RegexTester inActive')
        notepad.save()

    global REGEX_TESTER_IS_RUNNING
    REGEX_TESTER_IS_RUNNING = False

    clear_indicator()
    color_regex_tester_status()
    mark_regex_line(REGEX_LINE_CLEAR)

    global MATCH_POSITIONS
    MATCH_POSITIONS = {}

    editor1.setFocus(True)
예제 #6
0
def stop_regex_tester():
    editor.clearCallbacks([SCINTILLANOTIFICATION.UPDATEUI])
    notepad.clearCallbacks([NOTIFICATION.FILEBEFORECLOSE])

    notepad.activateBufferID(REGEX_TESTER_INPUT_TAB)

    if regex_tester_doc_is_current_doc():
        editor2.replace('RegexTester isActive', 'RegexTester inActive')
        notepad.save()

    global REGEX_TESTER_IS_RUNNING
    REGEX_TESTER_IS_RUNNING = False

    clear_indicator()
    color_regex_tester_status()
    mark_regex_line(REGEX_LINE_CLEAR)

    global MATCH_POSITIONS
    MATCH_POSITIONS = {}

    editor1.setFocus(True)
예제 #7
0
 def callback_scintillawrapper_void_int_int(self, args):
     editor.clearCallbacks()
     self.test_scintillawrapper_void_int_int()
     self.callbackCalled = True
예제 #8
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
예제 #9
0
 def callback_scintillawrapper_void_void_void(self, args):
     editor.clearCallbacks()
     editor.setText('')
     self.test_scintillawrapper_void_void_void()
     self.callbackCalled = True
예제 #10
0
 def callback_scintillawrapper_int_position_bool(self, args):
     editor.clearCallbacks()
     editor.setText('abcdef ghijkl mnopqrst')
     wordStart = editor.wordStartPosition(10, False)
     self.assertEqual(wordStart, 7)
     self.callbackCalled = True
예제 #11
0
 def tearDown(self):
     notepad.clearCallbacks()
     editor.clearCallbacks()
     editor.setSavePoint()
     notepad.close()
예제 #12
0
 def setUp(self):
     # Make doubly sure we've got no lingering callbacks waiting
     notepad.clearCallbacks()
     editor.clearCallbacks()
     notepad.new()
     self.callbackCalled = False