From a48b3d3750ac1a1e3b2f4da3494fa5fb23b66106 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 28 May 2024 10:52:48 +0400 Subject: [PATCH] Allow zero width space in the middle of text. --- ui/text/text.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 1e887a4..afaf7db 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -1812,8 +1812,7 @@ bool IsSpace(QChar ch) { || (ch == QChar::LineSeparator) || (ch == QChar::ObjectReplacementCharacter) || (ch == QChar::CarriageReturn) - || (ch == QChar::Tabulation) - || (ch == QChar(8203)/*Zero width space.*/); + || (ch == QChar::Tabulation); } bool IsDiacritic(QChar ch) { // diacritic and variation selectors @@ -1838,7 +1837,9 @@ bool IsReplacedBySpace(QChar ch) { } bool IsTrimmed(QChar ch) { - return (IsSpace(ch) || IsBad(ch)); + return IsSpace(ch) + || IsBad(ch) + || (ch == QChar(8203)); // zero width space } } // namespace Ui::Text