diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index 29e83a0b..bfd0be9a 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -301,8 +301,6 @@ class GuiDocEditor(QPlainTextEdit): self.docHeader.matchColours() self.docFooter.matchColours() - self._qDocument.syntaxHighlighter.initHighlighter() - return def initEditor(self) -> None: @@ -336,6 +334,9 @@ class GuiDocEditor(QPlainTextEdit): font.setPointSize(CONFIG.textSize) self._qDocument.setDefaultFont(font) + # Update highlighter settings + self._qDocument.syntaxHighlighter.initHighlighter() + # Set default text margins # Due to cursor visibility, a part of the margin must be # allocated to the document itself. See issue #1112.