From 0afa15f2dbe6b29a386652411da74cb9045e4f53 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 14 May 2024 09:29:21 +0200 Subject: [PATCH] Call highlighter init on editor init (#1865) --- novelwriter/gui/doceditor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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.