Bug 158441 - Basic code completion regression: overwrites dot; characters not visible while typing
Summary: Basic code completion regression: overwrites dot; characters not visible whil...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:24.2.0 target:7.6.5
Keywords: bibisected, bisected, regression
Depends on:
Blocks: BASIC-IDE
  Show dependency treegraph
 
Reported: 2023-11-29 15:54 UTC by Stéphane Guillou (stragu)
Modified: 2024-02-03 11:11 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-11-29 15:54:18 UTC
Steps:
1. Turn experimental features on: Tools > LibreOffice > Advanced > Experimental Features
2. In Tools > LibreOffice > Basic IDE, turn "Enable code completion" and "Use extended types" on.
3. In a macro, add the fist line from the example in the help page: https://help.libreoffice.org/7.6/en-US/text/shared/optionen/BasicIDE.html

Dim aPicker As com.sun.star.ui.dialogs.XFilePicker

4. In a new line, type "aPicker" followed by a dot "." and see the list of available methods pop down.
5. Type "get" and press the Tab key

Result: typed characters are not visible; the dot is removed and the syntax is now invalid.
Expected: as before, the characters typed are shown, and the autocomplete keeps the ".".

This is a regression: not reproduced in 6.4.7.2, reproduced in 7.0.6.2 and in recent trunk build:

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5589659829f8a1cef8ca1c8a468732105bbe231b
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Same with gen VCL plugin.

Bibisected with linux-64-7.0 repository to first bad build commit [155734100dc3fc515b4d7e1e19d6dd5a3094231f] which points to core commit:

commit c39bd1f6690ade936d62a66265b9b277061024d8
author	Caolán McNamara Wed Feb 19 10:13:15 2020 +0000
committer	Caolán McNamara Wed Feb 19 13:24:28 2020 +0100
weld CodeCompleteWindow
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89007

Caolán, can you please have a look?
Comment 1 Rafael Lima 2023-11-29 19:51:52 UTC
FTR this is repro with

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 60(Build:2)
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.3~rc2-0ubuntu0.23.10.1~lo2
Calc: threaded
Comment 2 Rafael Lima 2023-11-29 20:18:28 UTC
Code pointer here:
https://opengrok.libreoffice.org/xref/core/basctl/source/basicide/baside2b.cxx?r=bd6fb0cd#2702

TBH I do not understand the call to GetLastHighlightPortionTextSelection. If I simply comment out these two lines of code, the problem disappears:

GetParentEditView()->SetSelection( aTextSelection );
GetParentEditView()->DeleteSelected();
Comment 3 Commit Notification 2023-12-05 13:43:54 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6aba19406767a54bb61eaffb2903c1b2902da9a8

Resolves: tdf#158441 we don't want to return early for all handled keys

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2023-12-06 18:13:34 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/ea7c17960ddfe93249b17612662adc4694bd02b3

Resolves: tdf#158441 we don't want to return early for all handled keys

It will be available in 7.6.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Rafael Lima 2023-12-07 19:51:27 UTC
Thanks Caolan for the fix.

It works now, however there's another issue... when I press Enter, I was expecting for the selected entry to be entered without jumping to the next line.
Comment 6 Stéphane Guillou (stragu) 2023-12-08 06:06:51 UTC
(In reply to Rafael Lima from comment #5)
> It works now, however there's another issue... when I press Enter, I was
> expecting for the selected entry to be entered without jumping to the next
> line.
That was already the case before the regression, so I'd say a new report needs to be opened.

Fix verified in:

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks!