Skip to content

Commit 6a441b1

Browse files
authored
Fix syntax highlighter init (#1866)
2 parents e4acfb4 + 0afa15f commit 6a441b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

novelwriter/gui/doceditor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ def updateSyntaxColours(self) -> None:
301301
self.docHeader.matchColours()
302302
self.docFooter.matchColours()
303303

304-
self._qDocument.syntaxHighlighter.initHighlighter()
305-
306304
return
307305

308306
def initEditor(self) -> None:
@@ -336,6 +334,9 @@ def initEditor(self) -> None:
336334
font.setPointSize(CONFIG.textSize)
337335
self._qDocument.setDefaultFont(font)
338336

337+
# Update highlighter settings
338+
self._qDocument.syntaxHighlighter.initHighlighter()
339+
339340
# Set default text margins
340341
# Due to cursor visibility, a part of the margin must be
341342
# allocated to the document itself. See issue #1112.

0 commit comments

Comments
 (0)