def edit_text(
        self,
        text="",
        font_path=ENC_SANS_BOLD_FONT_PATH,
        validation_command=None,
        syntax_highlighting="",
    ):
        """Edit given text.

        Parameters
        ==========

        text (string)
            text to be edited.
        font_path (string)
            indicates the font style to be used when
            editing the contents; defaults to
            ENC_SANS_BOLD_FONT_PATH, which uses the normal
            font of the app. You can use
            FIRA_MONO_BOLD_FONT_PATH, to edit text
            representing code using a monospace font.
        validation_command (None or callable)
            if it is None, the instance is set up so that
            no validation is done;

            if it is a callable, it must accept a single
            argument and its return value is used to
            determined whether validation passed (when the
            return value is truthy) or not (when it is not
            truthy).
        syntax_highlighting (string)
            represents the name of a syntax used to
            highlight the text (for instance, 'python');
            if an empty string, which is the default value,
            or the name of an unsupported syntax is given,
            syntax highlighting is disabled;
            if, otherwise, the argument indicates a
            supported syntax, syntax highlighting is
            enabled and we use it to highlight the text
            when rendering it;
            even when the syntax highlight is enabled,
            though, the highlighting may fail, for instance,
            if there's a syntax error in the text; in such
            case, the text is rendered with no highlighting
            at all, but highlighting goes back to normal
            once the syntax error is solved;
            none of this is performed/managed here, though,
            but instead in the Cursor instance, to which we
            pass this argument.
        """
        ### blit a screen-size semitransparent surface in
        ### the canvas to increase constrast

        blit_on_screen(UNHIGHLIGHT_SURF_MAP[SCREEN_RECT.size], (0, 0))

        ### instantiate and store cursor in its own attribute,
        ### also referencing it locally (the text is stored
        ### and handled in the cursor instance)

        cursor = self.cursor = Cursor(
            text_editor=self,
            text=text,
            font_path=font_path,
            syntax_highlighting=syntax_highlighting,
        )

        ### set text attribute to None
        self.text = None

        ### process validation command
        self.validation_command = validation_command

        ### loop until running attribute is set to False

        self.running = True

        while self.running:

            ### perform various checkups for this frame;
            ###
            ### stuff like maintaing a constant framerate and more
            SERVICES_NS.frame_checkups()

            ### perform the GUD operations;
            ###
            ### note that, rather than using a single
            ### loop holder, both the cursor and text editor
            ### provide GUD operations together

            ## execute handle_input() and update() operations
            ## from the cursor object

            cursor.handle_input()
            cursor.update()

            ## execute drawing operation from the text editor
            self.draw()

        ### disable text editing events;
        ###
        ### this might only be needed if editor was in insert mode
        ### but it is ok to call regardless of that
        stop_text_input()

        ### blit the self.rect-size semitransparent obj
        ### over the screen to leave the self.rect
        ### temporarily darkened in case it keeps showing
        ### even after leaving this text editor (in some
        ### cases the loop holder which called this
        ### method might not care to update the area of the
        ### screen previously occupied by this color picker,
        ### making it so it keeps appearing as if it was
        ### still active on the screen)
        self.rect_size_semitransp_obj.draw()

        ### since we won't need the objects forming
        ### the text anymore, we clear all text-related
        ### objects in the cursor, to free memory
        cursor.free_up_memory()

        ### return text attribute
        return self.text
Edit given text.

        Parameters
        ==========

        text (string)
            text to be edited.
        font_path (string)
            indicates the font style to be used when
            editing the contents; defaults to
            ENC_SANS_BOLD_FONT_PATH, which uses the normal
            font of the app. You can use
            FIRA_MONO_BOLD_FONT_PATH, to edit text
            representing code using a monospace font.
        validation_command (None or callable)
            if it is None, the instance is set up so that
            no validation is done;

            if it is a callable, it must accept a single
            argument and its return value is used to
            determined whether validation passed (when the
            return value is truthy) or not (when it is not
            truthy).
        syntax_highlighting (string)
            represents the name of a syntax used to
            highlight the text (for instance, 'python');
            if an empty string, which is the default value,
            or the name of an unsupported syntax is given,
            syntax highlighting is disabled;
            if, otherwise, the argument indicates a
            supported syntax, syntax highlighting is
            enabled and we use it to highlight the text
            when rendering it;
            even when the syntax highlight is enabled,
            though, the highlighting may fail, for instance,
            if there's a syntax error in the text; in such
            case, the text is rendered with no highlighting
            at all, but highlighting goes back to normal
            once the syntax error is solved;
            none of this is performed/managed here, though,
            but instead in the Cursor instance, to which we
            pass this argument.
        
nodezator/textman/editor/main.py