Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed too much text being copied when copying chat messages #4812

Merged
merged 3 commits into from
Sep 17, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Sep 11, 2023

Description

This is a continuation of #3080. The same approach is used.

Because of the reply button being in every message, setting hasTrailingSpace on the last element (even the last text element) when building as mentioned in #3080 (comment) doesn't work.
Instead, hasTrailingSpace is set on the last layout element. With the button enabled, a trailing space is copied (as that space is visually selected). Without the button, no trailing space is copied. When selecting multiple lines, having no delimiter after a message is bad, so a newline is added (over a space to distinguish lines).

Fixes #2449.

Additionally, this fixes the issue of copying emotes when they're not selected (e.g. in a 🅰 with a selected, Chatterino would copy a 🅰 ).

@pajlada pajlada changed the title Copy the selected text, nothing else Fixed too much text being copied when copying chat messages Sep 17, 2023
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Will do a manual merge when another PR has been merged in

@pajlada pajlada enabled auto-merge (squash) September 17, 2023 11:56
@pajlada pajlada merged commit 3265df7 into Chatterino:master Sep 17, 2023
17 checks passed
@Nerixyz Nerixyz deleted the fix/selection branch September 17, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying selection adds an extra space at the end
2 participants