def edit_value(self):
        """Edit value of widget on the text editor."""
        ### retrieve edited text: this triggers the
        ### text editor edition session, which returns
        ### the edited text when the user finishes editing
        ### the text (or None, if the user decides to
        ### cancel the operation)

        text = edit_text(
            text=self.value,
            font_path=self.font_path,
            syntax_highlighting=self.syntax_highlighting,
            validation_command=self.validation_command,
        )

        ### if there is an edited text (it is not None)
        ### and it is different from the current value,
        ### set such text as the new value

        if text is not None and text != self.value:
            self.set(text)
Edit value of widget on the text editor.
nodezator/widget/textdisplay.py