fix: Double-space when using replies with an empty input box (#4041)

This commit is contained in:
nerix
2022-10-03 20:05:42 +02:00
committed by GitHub
parent 25bccc90b4
commit d5b8d89494
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -977,10 +977,14 @@ void SplitInput::setReply(std::shared_ptr<MessageThread> reply,
if (this->enableInlineReplying_)
{
// Only enable reply label if inline replying
auto replyPrefix = "@" + this->replyThread_->root()->displayName + " ";
auto replyPrefix = "@" + this->replyThread_->root()->displayName;
auto plainText = this->ui_.textEdit->toPlainText().trimmed();
if (!plainText.startsWith(replyPrefix))
{
if (!plainText.isEmpty())
{
replyPrefix.append(' ');
}
this->ui_.textEdit->setPlainText(replyPrefix + plainText + " ");
this->ui_.textEdit->moveCursor(QTextCursor::EndOfBlock);
}