Some changes to the syntax highlighter to match the rules in the autoreplace code
This commit is contained in:
@@ -151,7 +151,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
))
|
))
|
||||||
|
|
||||||
self.hRules.append((
|
self.hRules.append((
|
||||||
"<(.+?)>", {
|
"<(\S+?)>", {
|
||||||
0 : self.hStyles["replace"],
|
0 : self.hStyles["replace"],
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
@@ -187,7 +187,6 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
def highlightBlock(self, theText):
|
def highlightBlock(self, theText):
|
||||||
|
|
||||||
if self.theHandle is None:
|
if self.theHandle is None:
|
||||||
self.setCurrentBlockState(0)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if theText.startswith("@"):
|
if theText.startswith("@"):
|
||||||
@@ -221,8 +220,6 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
xLen = rxMatch.capturedLength(xM)
|
xLen = rxMatch.capturedLength(xM)
|
||||||
self.setFormat(xPos, xLen, xFmt[xM])
|
self.setFormat(xPos, xLen, xFmt[xM])
|
||||||
|
|
||||||
self.setCurrentBlockState(0)
|
|
||||||
|
|
||||||
if self.theDict is None or not self.spellCheck or theText.startswith("@"):
|
if self.theDict is None or not self.spellCheck or theText.startswith("@"):
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -234,10 +231,11 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
continue
|
continue
|
||||||
xPos = rxMatch.capturedStart(0)
|
xPos = rxMatch.capturedStart(0)
|
||||||
xLen = rxMatch.capturedLength(0)
|
xLen = rxMatch.capturedLength(0)
|
||||||
spFmt = self.format(xPos)
|
for x in range(xLen):
|
||||||
spFmt.setUnderlineColor(self.colSpell)
|
spFmt = self.format(xPos+x)
|
||||||
spFmt.setUnderlineStyle(QTextCharFormat.SpellCheckUnderline)
|
spFmt.setUnderlineColor(self.colSpell)
|
||||||
self.setFormat(xPos, xLen, spFmt)
|
spFmt.setUnderlineStyle(QTextCharFormat.SpellCheckUnderline)
|
||||||
|
self.setFormat(xPos+x, 1, spFmt)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user