Fix syntax highlighter init (#1866)

This commit is contained in:
Veronica Berglyd Olsen
2024-05-14 09:37:00 +02:00
committed by GitHub
+3 -2
View File
@@ -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.