Fix the highlighting of synopsis tag
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user