Improve the word saparation detection of the spell check highlighting

This commit is contained in:
Veronica K. B. Olsen
2020-06-13 20:44:27 +02:00
parent 95268a8ca5
commit ff6b4bcfa7
+3 -2
View File
@@ -203,9 +203,10 @@ class GuiDocHighlighter(QSyntaxHighlighter):
# Build a QRegExp for spell checker
# Include additional characters that the highlighter should
# consider to be word separators
wordSep = "_+"
wordSep = "_\+"
wordSep += nwUnicode.U_ENDASH
wordSep += nwUnicode.U_EMDASH
self.spellRx = QRegularExpression("\\b[^\\s%s]+\\b" % wordSep)
self.spellRx = QRegularExpression(r"\b[^\s"+wordSep+r"]+\b")
self.spellRx.setPatternOptions(QRegularExpression.UseUnicodePropertiesOption)
return True