Clear list of statements/docstrings when setting plain text

(this was causing a bug if the editor widget got reused)