def draw_visible_lines_and_self(self):
        """Draw visible lines, line number and cursor."""
        ### reference objects/data locally for quicker and
        ### easier access

        ## width of a digit's surface
        digit_width = self.__class__.DIGIT_SURF_WIDTH

        ## digit surf map
        digit_surf_map = self.DIGIT_SURF_MAP

        ## x coordinate from where we position line numbers
        line_number_x = self.te.line_number_x

        ### iterate over each line and its respective line
        ### number

        for lineno, line in enumerate(
            self.visible_lines, self.top_visible_line_index + 1  # start lineno
        ):

            ### draw line
            line.draw_colliding(EDITING_AREA_RECT)

            ### draw line's number

            ## use the x coordinate from where we blit
            ## line numbers as the starting value of our
            ## x coordinate
            lineno_x = line_number_x

            ## reference the y coordinate of the line
            ## locally for quicker and easier access
            line_y = line.rect.y

            ## justify the line number to the right using
            ## spaces and iterate over the characters,
            ## blitting each of them while updating the x
            ## coordinate so they are blitted one beside
            ## the other

            for char in str(lineno).rjust(self.max_char_needed, " "):

                ## blit line number character on screen
                ## (character is either a space or a digit)

                blit_on_screen(digit_surf_map[char], (lineno_x, line_y))

                ## increment x coordinate of line number
                lineno_x += digit_width

        ### draw cursor rect
        draw_rect(SCREEN, self.cursor_color, self.rect, 1)
Draw visible lines, line number and cursor.
nodezator/textman/editor/cursor/op.py