Beispiel #1
0
 def execute(self, key: int, model: Model):
     padding_len: int = model.get_padding_len()
     if model.at_field_end(LateralDirection.RIGHT):
         num_spaces = padding_len
     else:
         num_spaces = 1
     model.move(LateralDirection.RIGHT, num_spaces)
Beispiel #2
0
 def execute(self, key: int, model: Model):
     right = LateralDirection.RIGHT
     if model.at_field_end(right):
         model.move(
             right,
             model.get_padding_len() + len(model.get_neighbor_field(right)))
     else:
         model.move_field_end(right)
Beispiel #3
0
 def execute(self, key: int, model: Model):
     model.split_field()
Beispiel #4
0
 def is_relevant(self, key: int, model: Model):
     return key == self.key_map.value(Key.TAB) and not model.at_line_start()
Beispiel #5
0
 def execute(self, key: int, model: Model):
     model.combine_nodes()
Beispiel #6
0
 def execute(self, key: int, model: Model):
     model.move_end(LateralDirection.RIGHT)
Beispiel #7
0
 def execute(self, key: int, model: Model):
     model.delete(-1)
Beispiel #8
0
 def execute(self, key: int, model: Model):
     model.insert(chr(key))
Beispiel #9
0
 def is_relevant(self, key: int, model: Model):
     return key == self.key_map.value(Key.DELETE) and not model.at_line_end() \
            and model.at_field_end(LateralDirection.RIGHT)
Beispiel #10
0
 def execute(self, key: int, model: Model):
     model.toggle_current_node_collapsed()
Beispiel #11
0
 def execute(self, key: int, model: Model):
     model.move(VerticalDirection.DOWN)
Beispiel #12
0
 def is_relevant(self, key: int, model: Model):
     return key == self.key_map.value(
         Key.CTRL_RIGHT) and not model.at_line_end()
Beispiel #13
0
 def execute(self, key: int, model: Model):
     left = LateralDirection.LEFT
     if model.at_field_end(left):
         model.move(left, model.get_neighbor_column_width(left))
     else:
         model.move_field_end(left)
Beispiel #14
0
 def execute(self, key: int, model: Model):
     model.move(LateralDirection.LEFT)
Beispiel #15
0
 def is_relevant(self, key: int, model: Model):
     return not model.at_root() and (key == self.key_map.value(Key.BACKSPACE) and model.at_line_start()) \
            or key == self.key_map.value(Key.SHIFT_TAB)
Beispiel #16
0
 def execute(self, key: int, model: Model):
     model.save()
Beispiel #17
0
 def execute(self, key: int, model: Model):
     model.unindent_current_node()
Beispiel #18
0
 def execute(self, key: int, model: Model):
     model.signal_user_error()
Beispiel #19
0
 def execute(self, key: int, model: Model):
     model.combine_fields(LateralDirection.RIGHT)
Beispiel #20
0
 def execute(self, key: int, model: Model):
     model.split_node()
Beispiel #21
0
 def is_relevant(self, key: int, model: Model):
     return key == self.key_map.value(
         Key.BACKSPACE) and not model.at_field_end(LateralDirection.LEFT)
Beispiel #22
0
 def is_relevant(self, key: int, model: Model):
     return model.get_level() == 0 and key == self.key_map.value(
         Key.BACKSPACE) and model.at_line_start() and not model.at_root()
Beispiel #23
0
def main(window):
    file_path = get_file_path()
    view = LinuxView(window)
    model = Model(view, file_path)
    controller: Controller = Controller(model)
    controller.run()
Beispiel #24
0
 def execute(self, key, model: Model):
     model.page(VerticalDirection.UP)