Bug 445953

Summary: Triple-clicking line selects newline character and gets confused about bold status when the next line is bold
Product: [Plasma] plasmashell Reporter: Luiz Angelo De Luca <luizluca>
Component: Notes widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 6.2.4   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Luiz Angelo De Luca 2021-11-23 02:23:36 UTC
STEPS TO REPRODUCE
1. add a plasma applet note
2. type two lines
3. select the second line with triple click
4. click the bold button (the line is now bold)
5. select the first line with triple click, apply any formatting like bold

OBSERVED RESULT
6. click the bold button (the line is NOT bold) 

When I triple clicked the first line, the cursor was actually at the beginning of the second line and the bold button was shown as applied. It looks like it is misplacing the cursor when I do triple clicks.

The issue is not with bold but with any formatting. It does not happen if the applied format is different nor when it is removing a format.

EXPECTED RESULT
6. click the bold button (the line should be bold) 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.23.3 OpenSUSE Tumbleweed

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2021-11-23 18:00:37 UTC
Can confirm. It's because triple-clicking on the first line also selects the newline character which positions the insertion point on the second line, and something about that causes is to think the whole selection is bold. If you select only the first line itself and not also the newline character, the bug does not happen.