Fix triple click selection on message containing reply (#4131)

closes https://github.com/Chatterino/chatterino2/issues/4128
This commit is contained in:
kornes 2022-11-12 12:44:03 +00:00 committed by GitHub
parent 06b28ea0ab
commit 2a9c15b2de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,7 @@
## Unversioned ## Unversioned
- Major: Added support for Twitch's Chat Replies. [Wiki Page](https://wiki.chatterino.com/Features/#message-replies) (#3722, #3989, #4041, #4047, #4055, #4067, #4077, #3905) - Major: Added support for Twitch's Chat Replies. [Wiki Page](https://wiki.chatterino.com/Features/#message-replies) (#3722, #3989, #4041, #4047, #4055, #4067, #4077, #3905, #4131)
- Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694, #3875) - Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694, #3875)
- Major: Added support for emotes and badges from [7TV](https://7tv.app). [Wiki Page](https://wiki.chatterino.com/Third_party_services/#7tv) (#4002, #4062) - Major: Added support for emotes and badges from [7TV](https://7tv.app). [Wiki Page](https://wiki.chatterino.com/Third_party_services/#7tv) (#4002, #4062)
- Major: Added support for Right-to-Left Languages (#3958, #4139) - Major: Added support for Right-to-Left Languages (#3958, #4139)

View file

@ -776,17 +776,17 @@ int MessageLayoutContainer::getLastCharacterIndex() const
int MessageLayoutContainer::getFirstMessageCharacterIndex() const int MessageLayoutContainer::getFirstMessageCharacterIndex() const
{ {
static FlagsEnum<MessageElementFlag> flags; static FlagsEnum<MessageElementFlag> skippedFlags;
flags.set(MessageElementFlag::Username); skippedFlags.set(MessageElementFlag::RepliedMessage);
flags.set(MessageElementFlag::Timestamp); skippedFlags.set(MessageElementFlag::Timestamp);
flags.set(MessageElementFlag::Badges); skippedFlags.set(MessageElementFlag::Badges);
skippedFlags.set(MessageElementFlag::Username);
// Get the index of the first character of the real message // Get the index of the first character of the real message
// (no badges/timestamps/username)
int index = 0; int index = 0;
for (auto &element : this->elements_) for (auto &element : this->elements_)
{ {
if (element->getFlags().hasAny(flags)) if (element->getFlags().hasAny(skippedFlags))
{ {
index += element->getSelectionIndexCount(); index += element->getSelectionIndexCount();
} }