def edit_text_block_text(self, text_block):
        """Edit text block text on text editor."""
        ### retrieve its text
        text = text_block.data['text']

        ### edit the text

        edited_text = edit_text(
            text=text,
            font_path=FIRA_MONO_BOLD_FONT_PATH,
            syntax_highlighting='comment',
            validation_command=is_text_block_text_valid,
        )

        ### if the edited text is None, it means the user
        ### cancelled editing the text, so we just indicate
        ### such in the status bar

        if edited_text is None:
            set_status_message("Cancelled editing text of text block.")

        ### if the edited text is equal to the original
        ### one, we do nothing besides indicating such
        ### in the status bar

        elif edited_text == text:

            set_status_message(
                "Text of text block wasn't updated, since text didn't change"
            )

        else:

            ## insert the new text
            text_block.data['text'] = edited_text

            ## indicate the change in the data
            indicate_unsaved()

            ## indicate birdseye view state of window manager must
            ## have its objects updated next time it is set
            APP_REFS.ea.must_update_birdseye_view_objects = True

            ## indicate finished action in status bar
            set_status_message('Text of text block was edited.')

            ## rebuild the surface of the text block
            text_block.rebuild_surf()
Edit text block text on text editor.
nodezator/editing/data.py