Example #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
Example #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
Example #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
Example #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
Example #5
0
 def testVaiKeyCodeToText(self):
     self.assertEqual(vaitk.vaiKeyCodeToText(vaitk.Key.Key_A), 'a')
     self.assertEqual(vaitk.vaiKeyCodeToText(vaitk.Key.Key_Escape), '')