lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Incorrect highlighting when selecting text to end of line on multiline text

Open NanoGen opened this issue 2 years ago • 10 comments

Windows Lagrange client, v1.13.6

[Issue] When selecting some text (multiline display), the text shown highlighted as selected is accurate until you try to select to the last word on that line.

  • I first found this trying to highlight a text link that ran to the end of that line, and it was very frustrating that I couldn't select it properly to copy it.
  • Not all multiline text lines have this issue, I can't find a specific pattern or text that affects this.
  • It looks like the problem triggers (visually) as soon as you select the space in front of the last word (ex: the space between "will surely" in my .png ("select_correct_up_to_here.png")
  • After analyzing it, I think the selection is really still where my mouse cursor is, but the visual feedback is wrong as it jumps to show the beginning of the line through where I started (see "Select highlight incorrect.png")
  • If I ignore that visual oddity and continue to drag much farther to the right of that line the highlight corrects itself and show all of the correct text I wanted highlighted to copy (see "select_works_if_drag_far_right_past_text.png")
  • EDIT: another example .png; This issue is most noticeable when there is significant hanging dead space to the right of the last word on that line. The photo with the red rectangle/green line. If I want to select some or all of the text on the first line to the end, as I'm selecting text and my cursor enters the red box it will turn to showing incorrect highlight (almost the inverse of what I am selecting). My cursor has to continue right past the green line before the visual highlight corrects itself. This appears to indicate that my cursor has to pass out of the rectangle boundary of the multiline text block to show correct highlight again.
  • EDIT: so the WORKAROUND is to drag your cursor far right past the edge of the wrapping text block

An example on your gemlog: gemini://skyjake.fi/gemlog/2022-05_impending-hiatus.gmi select_works_if_drag_far_right_past_text Select highlight incorrect select_correct_up_to_here Cursor_Deadspace

NanoGen avatar Jun 11 '22 15:06 NanoGen

I have noticed similar issues occurring recently, but it seems quite infrequent. Will need to investigate.

skyjake avatar Jun 19 '22 04:06 skyjake

For me, this bug actually seems quite frequent.

krixano avatar Jul 07 '22 02:07 krixano

@krixano Any specific places or situations where you encounter this? I currently don't have a way to reproduce the issue.

skyjake avatar Jul 07 '22 07:07 skyjake

There's no pattern that comes to mind at the moment. I'll try to observe more closely about when it happens and get back to you.

krixano avatar Jul 07 '22 07:07 krixano

One thing I noticed, which was already hinted at, but I wanted to make more clear:

On lines that have this bug, when you select past the word (that won't highlight), the selection ends back at the beginning of the line, and the further into the word you go, the end point of the selection moves forward still - it just starts back at the beginning of the line for some reason.

Also, the highlight endpoint moves based on the width of the characters of the word that won't highlight, except for the last character of that word. The space before the word that also won't highlight is also not included in this.

And, resizing the window will change which lines have this bug.

krixano avatar Jul 07 '22 07:07 krixano

Another interesting thing.... when you go past the word, and the highlight gets all funky, if you stop the cursor and just copy the selected text, it will still be copying the stuff that was supposed to be highlighted, with exception to the last letter of the line.

krixano avatar Jul 07 '22 08:07 krixano

Yet another thing :D

Highlighting by word by double-click dragging works correctly, even when regular (character) highlight doesn't. And copying from the select-by-word includes the last character.

krixano avatar Jul 07 '22 08:07 krixano

Another example to see what I see:

gemini://breadpunk.club/~crusty/log/2021-04-08.gmi

Go to the INGREDIENTS section. Bug on these lines - these fail to select words properly to the end of each single line: [While highlighting/holding down left mouse button, and hitting the last word or anywhere on same line to the right of the last word] all-purpose flour baking powder white sugar brown sugar tablespoon water

These lines work ok when text is selected to the end of the single line: baking soda fine salt chocolate chips canola oil for garnish

Additional note: It is NOT AS EVIDENT when highlighting/selecting multi-lines, but the bug is still there.

NanoGen avatar Jul 23 '22 03:07 NanoGen

I have the same problem. I'm having trouble selecting a particular line of text.

When I go to select the entire line:

Enable DNS over HTTPS

on this page:

gemini://pwshnotes.flounder.online/gemlog/2022-04-26-firefox-settings.gmi

There is a visual bug where the highlight snaps to the beginning of the line.

Only part of the line shows as selected even though I've motioned over the entire line with my mouse.

If I then copy, I get all but the last character in the clipboard.

Double-clicking selects the whole line. But that includes the leading asterisk which breaks my workflow.

I don't have the problem if I view the page as plain text.

I've tried editing the page and typing the line from scratch. But I have the same problem.

This is the only example I've come across. But this line always has the problem for me.

Lagrange 1.13.7 Manjaro 21.3.5 Kernel 5.18.12 XFCE 4.16

Mike

juvtib avatar Jul 26 '22 06:07 juvtib

@skyjake Thanks for the patch. I'm looking forward to the next release.

juvtib avatar Aug 27 '22 04:08 juvtib

Fix included in v1.13.8.

skyjake avatar Nov 16 '22 15:11 skyjake