Improve the word saparation detection of the spell check highlighting
This commit is contained in:
@@ -203,9 +203,10 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
# Build a QRegExp for spell checker
|
# Build a QRegExp for spell checker
|
||||||
# Include additional characters that the highlighter should
|
# Include additional characters that the highlighter should
|
||||||
# consider to be word separators
|
# consider to be word separators
|
||||||
wordSep = "_+"
|
wordSep = "_\+"
|
||||||
|
wordSep += nwUnicode.U_ENDASH
|
||||||
wordSep += nwUnicode.U_EMDASH
|
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)
|
self.spellRx.setPatternOptions(QRegularExpression.UseUnicodePropertiesOption)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user