Update editor and highlight, and update tests

This commit is contained in:
Veronica Berglyd Olsen
2024-04-28 18:05:53 +02:00
parent e9596e1bbc
commit e01e14075c
4 changed files with 829 additions and 706 deletions
+6 -5
View File
@@ -358,12 +358,12 @@ class GuiDocHighlighter(QSyntaxHighlighter):
elif text.startswith("%"): # Comments
self.setCurrentBlockState(BLOCK_TEXT)
hRules = self._cmnRules
cStyle, cMod, _, cDot, cPos = processComment(text)
cLen = len(text) - cPos
xOff = cPos
if cMod == "ERR":
self.setFormat(0, cPos, self._hStyles["invalid"])
elif cStyle == nwComment.PLAIN:
if cStyle == nwComment.PLAIN:
self.setFormat(0, cLen, self._hStyles["hidden"])
elif cStyle == nwComment.IGNORE:
self.setFormat(0, cLen, self._hStyles["strike"])
@@ -376,9 +376,10 @@ class GuiDocHighlighter(QSyntaxHighlighter):
self.setFormat(0, cPos, self._hStyles["modifier"])
self.setFormat(cPos, cLen, self._hStyles["hidden"])
hRules = self._cmnRules
elif text.startswith("["): # Special Command
self.setCurrentBlockState(BLOCK_TEXT)
hRules = self._txtRules
sText = text.rstrip().lower()
if sText in ("[newpage]", "[new page]", "[vspace]"):
self.setFormat(0, len(text), self._hStyles["code"])