Fix the highlighting of synopsis tag

This commit is contained in:
Veronica K. B. Olsen
2019-11-20 19:09:32 +01:00
parent c0828c7f1d
commit f9a06f3425
11 changed files with 18 additions and 1 deletions
@@ -17,3 +17,4 @@ value = 184, 200, 0
spellcheckline = 200, 46, 0
tagerror = 46, 200, 0
replacetag = 0, 184, 46
modifier = 200, 120, 0
@@ -17,3 +17,4 @@ value = 50, 150, 50
spellcheckline = 200, 0, 0
tagerror = 0, 150, 0
replacetag = 0, 150, 0
modifier = 150, 110, 30
+1
View File
@@ -40,3 +40,4 @@ value = 150, 74, 193
spellcheckline = 222, 61, 58
tagerror = 8, 145, 106
replacetag = 42, 162, 152
modifier = 224, 175, 5
+1
View File
@@ -40,3 +40,4 @@ value = 199, 146, 234
spellcheckline = 247, 140, 108
tagerror = 173, 219, 103
replacetag = 127, 219, 202
modifier = 236, 196, 141
+1
View File
@@ -40,3 +40,4 @@ value = 137, 89, 168
spellcheckline = 240, 40, 41
tagerror = 113, 140, 0
replacetag = 62, 153, 159
modifier = 245, 135, 31
@@ -40,3 +40,4 @@ value = 178, 148, 187
spellcheckline = 204, 102, 102
tagerror = 181, 189, 104
replacetag = 138, 190, 183
modifier = 222, 147, 95
@@ -40,3 +40,4 @@ value = 235, 187, 255
spellcheckline = 255, 157, 164
tagerror = 209, 241, 169
replacetag = 153, 255, 255
modifier = 255, 197, 143
@@ -40,3 +40,4 @@ value = 195, 151, 216
spellcheckline = 213, 78, 83
tagerror = 185, 202, 74
replacetag = 112, 192, 177
modifier = 231, 140, 69
@@ -40,3 +40,4 @@ value = 204, 153, 204
spellcheckline = 242, 119, 122
tagerror = 153, 204, 153
replacetag = 102, 204, 204
modifier = 249, 145, 57
+2
View File
@@ -78,6 +78,7 @@ class GuiTheme:
self.colSpell = [ 0, 0, 0]
self.colTagErr = [ 0, 0, 0]
self.colRepTag = [ 0, 0, 0]
self.colMod = [ 0, 0, 0]
# Changeable Settings
self.guiTheme = None
@@ -217,6 +218,7 @@ class GuiTheme:
self.colSpell = self._loadColour(confParser, cnfSec, "spellcheckline")
self.colTagErr = self._loadColour(confParser, cnfSec, "tagerror")
self.colRepTag = self._loadColour(confParser, cnfSec, "replacetag")
self.colMod = self._loadColour(confParser, cnfSec, "modifier")
logger.info("Loaded syntax theme '%s'" % self.guiSyntax)
+7 -1
View File
@@ -75,6 +75,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
self.colSpell = QColor(*self.theTheme.colSpell)
self.colTagErr = QColor(*self.theTheme.colTagErr)
self.colRepTag = QColor(*self.theTheme.colRepTag)
self.colMod = QColor(*self.theTheme.colMod)
self.colTrail = QColor(*self.theTheme.colEmph,64)
self.hStyles = {
@@ -98,6 +99,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
"replace" : self._makeFormat(self.colRepTag),
"hidden" : self._makeFormat(self.colComm),
"keyword" : self._makeFormat(self.colKey),
"modifier" : self._makeFormat(self.colMod),
"value" : self._makeFormat(self.colVal),
}
@@ -250,7 +252,11 @@ class GuiDocHighlighter(QSyntaxHighlighter):
self.setFormat(4, len(theText), self.hStyles["header4"])
elif theText.startswith("%"): # Comments
self.setFormat(0, len(theText), self.hStyles["hidden"])
if theText.startswith("%synopsis:"):
self.setFormat(0, 10, self.hStyles["modifier"])
self.setFormat(10, len(theText), self.hStyles["hidden"])
else:
self.setFormat(0, len(theText), self.hStyles["hidden"])
else: # Text Paragraph
for rX, xFmt in self.rxRules: