def add_line(self, where):
        """Add new line above or below current one.

        Parameters
        ==========
        where (string)
            indicates whether the line is to be added
            above or below the current one.
        """
        ### define an index wherein to insert the new
        ### line, depending on whether it must be inserted
        ### above or below the current one

        ## if we want a new line above the current one,
        ## we want to insert a new line where the current
        ## line is
        if where == "above":
            index = self.row

        ## if we want a new line below the current one we
        ## use the index of the next line (current line plus
        ## one)
        elif where == "below":
            index = self.row + 1

        ## there shouldn't possibly be another scenario,
        ## in which case we indicate it by raising an
        ## exception

        else:

            raise RuntimeError(
                (
                    "Entered 'else' block never supposed to"
                    " be entered; logic went wrong somewhere"
                )
            )

        ### insert new line at the chosen index
        self.lines.insert(index, Line(""))

        ### 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 cursor row and column according to
        ### whether the line was inserted above or below
        ### the current one

        if where == "above":

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

            ## go to the beginning of line, since it is
            ## empty; we could also just have used the
            ## reposition_ins() method here
            self.go_to_line_start_ins()

        elif where == "below":

            ## the go_down_ins() call executed after this
            ## "if block" automatically updates the visible
            ## lines when the cursor is in the last visible
            ## line;
            ##
            ## if the cursor isn't in the last visible line,
            ## though, we'll have to execute it ourselves,
            ## which is what we do here
            if self.visible_row != NUMBER_OF_VISIBLE_LINES - 1:
                self.update_visible_lines()

            ## make it so the cursor goes down one line,
            ## so it is now in the new line
            self.go_down_ins()

        ### also check the need to update the editing area
        self.check_editing_area()
Add new line above or below current one.

        Parameters
        ==========
        where (string)
            indicates whether the line is to be added
            above or below the current one.
        
nodezator/textman/editor/cursor/modes/normal.py