Пример #1
0
def regex_tester_buffer_activated_callback(args):
    global PREVIOUS_REGEX
    set_current_buffer_id()

    if not CURRENT_BUFFER_ID in PREVIOUS_REGEX:
        PREVIOUS_REGEX[CURRENT_BUFFER_ID] = ''

    if not REGEX_TESTER_IS_RUNNING:
        global COLORED_DOCS_LIST
        if args['bufferID'] in COLORED_DOCS_LIST:
            clear_indicator()
            COLORED_DOCS_LIST.remove(args['bufferID'])

        if len(COLORED_DOCS_LIST) == 0:
            notepad.clearCallbacks([NOTIFICATION.BUFFERACTIVATED])
Пример #2
0
def regex_tester_buffer_activated_callback(args):
    global PREVIOUS_REGEX
    set_current_buffer_id()

    if not PREVIOUS_REGEX.has_key(CURRENT_BUFFER_ID):
        PREVIOUS_REGEX[CURRENT_BUFFER_ID] = ''

    if not REGEX_TESTER_IS_RUNNING:
        global COLORED_DOCS_LIST
        if args['bufferID'] in COLORED_DOCS_LIST:
            clear_indicator()
            COLORED_DOCS_LIST.remove(args['bufferID'])

        if len(COLORED_DOCS_LIST) == 0:
            notepad.clearCallbacks([NOTIFICATION.BUFFERACTIVATED])
Пример #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 tearDown(self):
     notepad.clearCallbacks()
     editor.clearCallbacks()
     editor.setSavePoint()
     notepad.close()
Пример #8
0
 def setUp(self):
     # Make doubly sure we've got no lingering callbacks waiting
     notepad.clearCallbacks()
     editor.clearCallbacks()
     notepad.new()
     self.callbackCalled = False