More descriptive spell check tooltip

This commit is contained in:
Veronica K. B. Olsen
2020-10-04 21:21:30 +02:00
parent ac96636f8a
commit 96a5b9e4ae
3 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -198,7 +198,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
# Build a QRegExp for spell checker
# Include additional characters that the highlighter should
# consider to be word separators
wordSep = r"-_\+/"
wordSep = r"\-_\+/"
wordSep += nwUnicode.U_ENDASH
wordSep += nwUnicode.U_EMDASH
self.spellRx = QRegularExpression(r"\b[^\s"+wordSep+r"]+\b")
@@ -314,7 +314,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
while rxSpell.hasNext():
rxMatch = rxSpell.next()
if not self.theDict.checkWord(rxMatch.captured(0)):
if rxMatch.captured(0).isupper():
if rxMatch.captured(0).isupper() or rxMatch.captured(0).isnumeric():
continue
xPos = rxMatch.capturedStart(0)
xLen = rxMatch.capturedLength(0)