diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index d7b64290..e8e9bb4e 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -161,12 +161,15 @@ class GuiDocEditor(QTextEdit): # Initialise the syntax highlighter self.hLight.initHighlighter() - # If we have a document open, we should reload it in case the font changed + # If we have a document open, we should reload it in case the font changed, otherwise + # we just clear the editor entirely, which makes it read only. if self.theHandle is not None: tHandle = self.theHandle self.clearEditor() self.loadText(tHandle) self.changeWidth() + else: + self.clearEditor() return True