Exemple #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)
Exemple #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)
Exemple #3
0
 def execute(self, key: int, model: Model):
     model.split_field()
Exemple #4
0
 def is_relevant(self, key: int, model: Model):
     return key == self.key_map.value(Key.TAB) and not model.at_line_start()
Exemple #5
0
 def execute(self, key: int, model: Model):
     model.combine_nodes()
Exemple #6
0
 def execute(self, key: int, model: Model):
     model.move_end(LateralDirection.RIGHT)
Exemple #7
0
 def execute(self, key: int, model: Model):
     model.delete(-1)
Exemple #8
0
 def execute(self, key: int, model: Model):
     model.insert(chr(key))
Exemple #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)
Exemple #10
0
 def execute(self, key: int, model: Model):
     model.toggle_current_node_collapsed()
Exemple #11
0
 def execute(self, key: int, model: Model):
     model.move(VerticalDirection.DOWN)
Exemple #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()
Exemple #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)
Exemple #14
0
 def execute(self, key: int, model: Model):
     model.move(LateralDirection.LEFT)
Exemple #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)
Exemple #16
0
 def execute(self, key: int, model: Model):
     model.save()
Exemple #17
0
 def execute(self, key: int, model: Model):
     model.unindent_current_node()
Exemple #18
0
 def execute(self, key: int, model: Model):
     model.signal_user_error()
Exemple #19
0
 def execute(self, key: int, model: Model):
     model.combine_fields(LateralDirection.RIGHT)
Exemple #20
0
 def execute(self, key: int, model: Model):
     model.split_node()
Exemple #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)
Exemple #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()
Exemple #23
0
def main(window):
    file_path = get_file_path()
    view = LinuxView(window)
    model = Model(view, file_path)
    controller: Controller = Controller(model)
    controller.run()
Exemple #24
0
 def execute(self, key, model: Model):
     model.page(VerticalDirection.UP)