Make sure editor is clear if we're not re-loading a document when we're initialising it

This commit is contained in:
Veronica K. B. Olsen
2019-10-31 12:46:52 +01:00
parent a02d08afa3
commit 7969c58351
+4 -1
View File
@@ -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