Fixed comma appended to username completion when not at the beginning of the message (#3060)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/Clipboard.hpp"
|
||||
#include "util/DistanceBetweenPoints.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/IncognitoBrowser.hpp"
|
||||
#include "util/StreamerMode.hpp"
|
||||
#include "util/Twitch.hpp"
|
||||
@@ -48,6 +49,7 @@
|
||||
#include "widgets/helper/EffectLabel.hpp"
|
||||
#include "widgets/helper/SearchPopup.hpp"
|
||||
#include "widgets/splits/Split.hpp"
|
||||
#include "widgets/splits/SplitInput.hpp"
|
||||
|
||||
#define DRAW_WIDTH (this->width())
|
||||
#define SELECTION_RESUME_SCROLLING_MSG_THRESHOLD 3
|
||||
@@ -1804,8 +1806,9 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
|
||||
}
|
||||
break;
|
||||
case Qt::RightButton: {
|
||||
auto split = dynamic_cast<Split *>(this->parentWidget());
|
||||
auto insertText = [=](QString text) {
|
||||
if (auto split = dynamic_cast<Split *>(this->parentWidget()))
|
||||
if (split)
|
||||
{
|
||||
split->insertTextToInput(text);
|
||||
}
|
||||
@@ -1815,7 +1818,11 @@ void ChannelView::handleMouseClick(QMouseEvent *event,
|
||||
if (link.type == Link::UserInfo)
|
||||
{
|
||||
const bool commaMention = getSettings()->mentionUsersWithComma;
|
||||
insertText("@" + link.value + (commaMention ? ", " : " "));
|
||||
const bool isFirstWord =
|
||||
split && split->getInput().isEditFirstWord();
|
||||
auto userMention =
|
||||
formatUserMention(link.value, isFirstWord, commaMention);
|
||||
insertText("@" + userMention + " ");
|
||||
}
|
||||
else if (link.type == Link::UserWhisper)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user