Don't spellcheck command lines, and uppercase words

This commit is contained in:
Veronica K. B. Olsen
2019-05-26 00:37:23 +02:00
parent cfa9c8c9c8
commit 8e9f6ce4c7
+2 -1
View File
@@ -194,13 +194,14 @@ class GuiDocHighlighter(QSyntaxHighlighter):
self.setCurrentBlockState(0)
if self.theDict is None or not self.spellCheck:
if self.theDict is None or not self.spellCheck or theText.startswith("@"):
return
rxSpell = self.spellRx.globalMatch(theText.replace("_"," "), 0)
while rxSpell.hasNext():
rxMatch = rxSpell.next()
if not self.theDict.check(rxMatch.captured(0)):
if rxMatch.captured(0) == rxMatch.captured(0).upper(): continue
xPos = rxMatch.capturedStart(0)
xLen = rxMatch.capturedLength(0)
spFmt = self.format(xPos)