-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Message edit: triple click on a word should select the line, not the whole message #28805
Comments
It seems that Telegram Desktop assumes that the whole edited message is a single line/"paragraph". When, however, you add a new line while editing a message, the behavior for that line is as expected (triple-clicking the new line only selects that line) |
Found it. These lines from desktop-app/lib_ui@1d82347 are responsible for the problem (commenting them out fixes the issue). That appears very surprising: is that the intended behavior? Anyway, should I reopen the issue in lib_ui? |
In `InputField::PrepareForInsert`, avoid replacing all line break characters with `kSoftLine` (aka `QChar::LineSeparator`) because that makes the selection behavior inconsistent (different for typed text and restored text, e.g., from a draft). Instead, only soften line breaks inside formatting tags. Should fix telegramdesktop/tdesktop#28805
@kolayne Only with soft breaks the wysiwyg multiline blockquote editing works unfortunately. It could be possible to inspect whether the currently made change will end up in a blockquote or code block and use soft blocks only for them, but this was not done yet. |
@john-preston, that's what I did, I believe! I've also double checked that with my fix (desktop-app/lib_ui#253) editing blockquotes and code blocks works, as well as exiting those blocks by inserting triple newline. |
Steps to reproduce
Expected behaviour
The line that contains the word is selected (just like it happens when I triple click a word when writing a new message or when I triple click a word in a message in the chat view)
Actual behaviour
The whole message is selected
Operating system
Ubuntu 22.04, i3 version 4.20.1 // Arch Linux, i3 version 4.24
Version of Telegram Desktop
5.9 // 5.9.2 beta
Installation source
Static binary from official website
Crash ID
No response
Logs
No response
The text was updated successfully, but these errors were encountered: