From d5b8d89494141ff3627585495fa5754488830d3a Mon Sep 17 00:00:00 2001 From: nerix Date: Mon, 3 Oct 2022 20:05:42 +0200 Subject: [PATCH] fix: Double-space when using replies with an empty input box (#4041) --- CHANGELOG.md | 2 +- src/widgets/splits/SplitInput.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd7b6f6e..1516dca46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unversioned -- Major: Added support for Twitch's Chat Replies. [Wiki Page](https://wiki.chatterino.com/Features/#message-replies) (#3722, #3989) +- Major: Added support for Twitch's Chat Replies. [Wiki Page](https://wiki.chatterino.com/Features/#message-replies) (#3722, #3989, #4041) - Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694, #3875) - Minor: Added highlights for `Elevated Messages`. (#4016) - Minor: Removed total views from the usercard, as Twitch no longer updates the number. (#3792) diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index f78ce2746..b45146466 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -977,10 +977,14 @@ void SplitInput::setReply(std::shared_ptr 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); }