fix: Double-space when using replies with an empty input box (#4041)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user