Bug 160202

Summary: EDITING keyboard selection in Basic editor: selection extended one position too far (e.g. Ctrl+Right selects _two_ strings in stead of one)
Product: LibreOffice Reporter: Cor Nouws <cno>
Component: BASICAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: cno, rafael.palma.lima
Priority: medium Keywords: bibisectRequest
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Cor Nouws 2024-03-14 12:33:35 UTC
Open Basic editor
Edit one of the Application macro's.
Go to the start of a line with multiple vars, expressions, *
press Ctrl+Right
  > this selects _two_ strings
should one

found in Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 56767830b81fa21382b87cf43d78b1c73ca5dbd8
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Rafael Lima 2024-03-28 13:44:37 UTC
This is actually a very old bug... Ctrl + Left/Right has never worked well for me in the Basic editor.

For instance, consider the cursor is in the first position of the following line:

Global oKeyHandler As Object

If you press Ctrl+Right the cursor will go to the end of oKeyHandler. In any other code editor, the cursor would go to the beginning of oKeyHandler.

I'd say the problem is in TextView::KeyInput, located in:
/core/vcl/source/edit/textview.cxx
Comment 2 Cor Nouws 2024-04-17 18:57:53 UTC
(In reply to Rafael Lima from comment #1)
> This is actually a very old bug... Ctrl + Left/Right has never worked well
> for me in the Basic editor.
IIRC, it did for me... 
Starting (random) 5.0.6.3 shows it behaved as expected in that version > bibisectrequest.

> ...
> I'd say the problem is in TextView::KeyInput, located in:
> /core/vcl/source/edit/textview.cxx
Will look into that.