def break_line(self):
        """Break current line in two where cursor stands."""
        ### reference current line locally
        current_line = self.lines[self.row]

        ### instantiate a new line holding the characters
        ### from the part of the line where the cursor sits
        ### and on
        new_line = Line(current_line[self.col :])

        ### make the current line hold only the part of the
        ### line before the cursor
        current_line[:] = current_line[: self.col]

        ### define the index of the new line
        new_line_index = self.row + 1

        ### insert the new line in front of the current one
        self.lines.insert(new_line_index, new_line)

        ### reposition characters of the new line, so they
        ### are all aligned with the rect in the line's
        ### 'line_rect' attribute
        new_line.reposition_chars()

        ### update the index of the cursor's row and column
        ### so that it now sits at the beginning of the
        ### new line
        self.row, self.col = new_line_index, 0

        ### define the range of visible line indices;
        ### we'll need this information in the next
        ### "if block"

        visible_range = range(
            self.top_visible_line_index,
            self.top_visible_line_index + NUMBER_OF_VISIBLE_LINES,
        )

        ### if the index of the new inserted line is within
        ### the visible range, we increment the index of the
        ### visible row
        if new_line_index in visible_range:
            self.visible_row += 1

        ### otherwise, we increment the index of the top
        ### visible line, so that when we update the visible
        ### lines, the new line now appears at the bottom
        else:
            self.top_visible_line_index += 1

        ### since some change took place, we execute the
        ### edition routine;
        ###
        ### it is important to execute this before updating
        ### the visible lines, in order to prevent syntax
        ### highlighting to be applied to the visible lines,
        ### in case the syntax highlighting is enabled
        self.edition_routine()

        ### update the visible lines, since we just added a
        ### new one
        self.update_visible_lines()

        ### now we reposition the cursor without actually
        ### changing its row and column, just for the
        ### side-effect of causing the cursor to be
        ### properly positioned at its current row and
        ### column
        self.reposition_ins()

        ### also check the need to update the editing area
        self.check_editing_area()
Break current line in two where cursor stands.
nodezator/textman/editor/cursor/modes/insert.py