-
-
Notifications
You must be signed in to change notification settings - Fork 458
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
Double/triple click selection of long words does not select all characters #4960
Comments
double-click selection ends selection on the line's end rather than word end, i tested c2 2.4.4 and it behaves the same so likely it never worked as expected. But your videos shows more problems:
|
When adding a The following would be done when calling (a new) # this is pseudocode
startIndex, startElement = getElementAt(pos)
endElement = startElement
endIndex = startIndex + endElement.getSelectionIndexCount()
while startElement.hasPrev:
startElement = elementBefore(startElement)
startIndex -= startElement.getSelectionIndexCount()
while endElement.hasNext:
endElement = elementAfter(endElement)
endIndex += endElement.getSelectionIndexCount()
if endElement.hasTrailingSpace():
endIndex -= 1
return startIndex, endIndex I think this could extend Example: Say you have the message "b³ a⁴² b³", which could get broken up like this:
This would result in the following layout elements:
Suppose the user double-clicks on element 2.
Now, |
Good idea. I looked into it a bit more yesterday and quickly hacked together a way to get the length of the original word and just return that as the selection length, which surprisingly works a lot of the times but would break in the example you gave (the selection would only go forward from the line). |
Checklist
Describe your issue
When double clicking on a long word in a message, the selection does not span the entire word. This is also exhibited by triple clicking the message.
Example message:
Screenshots
Double click selection:
Expected text selection:
widepepohappycliminghardo4housewithcomodohypeontopholdingapepegadragonpoganonactionfigure
Actual text selection:
widepepohappycliminghardo4housewithcomodohypeontopholdingapepega
The following videos demonstrate double clicking then triple clicking behaviour.
Chatterino2_SelectionBug_Singleline.mp4
Chatterino2_SelectionBug_Multiline.mp4
OS and Chatterino Version
Chatterino 2.4.6 (commit 95620e6) built with Qt 6.6.0 Running on Arch Linux, kernel: 6.6.1-zen1-1-zen
The text was updated successfully, but these errors were encountered: