예제 #1
0
    def _handleNonDirectionalKey(cls, event, buffer, global_state, edit_area, editor_controller):
        if Key.Key_A <= event.key() <= Key.Key_Z:
            marker = vaitk.vaiKeyCodeToText(event.key())
            found = buffer.document.lineMetaInfo("Bookmark").findWhere(lambda x: x == marker)
            if len(found) != 0:
                buffer.cursor.toLine(list(found.keys())[0])

        return CommandState
예제 #2
0
    def _handleNonDirectionalKey(cls, event, buffer, global_state, edit_area,
                                 editor_controller):
        if Key.Key_A <= event.key() <= Key.Key_Z:
            marker = vaitk.vaiKeyCodeToText(event.key())
            found = buffer.document.lineMetaInfo("Bookmark").findWhere(
                lambda x: x == marker)
            if len(found) != 0:
                buffer.cursor.toLine(list(found.keys())[0])

        return CommandState
예제 #3
0
    def _handleNonDirectionalKey(cls, event, buffer, global_state, edit_area, editor_controller):
        if Key.Key_A <= event.key() <= Key.Key_Z:
            marker = vaitk.vaiKeyCodeToText(event.key())

            data_dict = {}
            found = buffer.document.lineMetaInfo("Bookmark").findWhere(lambda x: x == marker)
            for line_num in found:
                data_dict[line_num] = None
            if buffer.cursor.line not in found:
                data_dict[buffer.cursor.line] = marker
            buffer.document.lineMetaInfo("Bookmark").setDataForLines(data_dict)

        return CommandState
예제 #4
0
    def _handleNonDirectionalKey(cls, event, buffer, global_state, edit_area,
                                 editor_controller):
        if Key.Key_A <= event.key() <= Key.Key_Z:
            marker = vaitk.vaiKeyCodeToText(event.key())

            data_dict = {}
            found = buffer.document.lineMetaInfo("Bookmark").findWhere(
                lambda x: x == marker)
            for line_num in found:
                data_dict[line_num] = None
            if buffer.cursor.line not in found:
                data_dict[buffer.cursor.line] = marker
            buffer.document.lineMetaInfo("Bookmark").setDataForLines(data_dict)

        return CommandState
예제 #5
0
파일: test_vixtk.py 프로젝트: gavd89/vai
 def testVaiKeyCodeToText(self):
     self.assertEqual(vaitk.vaiKeyCodeToText(vaitk.Key.Key_A), 'a')
     self.assertEqual(vaitk.vaiKeyCodeToText(vaitk.Key.Key_Escape), '')