Avoid accidental loss of unsaved text when the editor is dirty