Bug 57879 - EDITING : consider an underscore to be part of a string
Summary: EDITING : consider an underscore to be part of a string
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: Other All
: medium minor
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.0.0
Keywords: needsDevEval
Depends on:
Blocks: Macro-UNOAPI
  Show dependency treegraph
 
Reported: 2012-12-04 13:55 UTC by Cor Nouws
Modified: 2024-09-22 09:29 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 Cor Nouws 2012-12-04 13:55:55 UTC
Underscores are frequentely used in names of procedures or variables

therefore it would be great if those are considered to be a part of the string, so that when one makes a selection by
  double click
or
  Ctrl+Shft+Left/Right
the whole string is selected in one time :-)

thanks,
Comment 1 Cor Nouws 2012-12-04 13:58:39 UTC
(feel free to send me a few pointers ;-) )
Comment 2 ababaaa 2015-02-13 16:50:04 UTC
Hello I am a beginner I would like to work on this as my first hack.
Can you guide me where should I start.
Thanks
Comment 3 Yash Patel 2015-02-15 21:37:32 UTC
Hello, I would like to take up this one. Can you please guide me the files I need to look into. Thanks
Comment 4 Cor Nouws 2015-02-16 09:22:49 UTC
@Lovekesh, @Yash,

Hi, thanks a lot for willing to look into this one!

As you see, indeed there are no code pointers here.
I fail time - alas  - to do that.

So if you have no idea yourself, from some earlier experience, maybe it's better to start with issues that _do_ have code pointers. Many of the reported easyHacks do have that.

Regards,
Cor
Comment 5 Robinson Tryon (qubit) 2015-12-10 07:20:07 UTC Comment hidden (obsolete)
Comment 6 Jim Avera 2018-11-08 01:03:15 UTC
Any progress on this?   

Problem is still there in 5.5.0.0.alpha0+ (2017-05-2).

According to the Open Office Basic guide, underscores *are* explicitly permitted in identifiers (called "markers" in the guide).   The IDE should include underscores when double-clicking on an identifier.

https://wiki.openoffice.org/w/images/c/c1/BasicGuide_OOo3.2.0.pdf
Comment 7 Jim Avera 2018-11-08 01:06:02 UTC
The OP was very polite by marking this as an "enhancement" request, but I think it is legitimately a bug because the "spec" (if we can call it that) says that underscores are supposed to be allowed in identifiers.

And they aren't fully allowed, since identifiers containing them can not be (easily) selected in the IDE
Comment 8 Buovjaga 2019-08-11 10:43:00 UTC
Still repro.

Arch Linux 64-bit
Version: 6.4.0.0.alpha0+
Build ID: 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 6 August 2019
Comment 9 Andreas Heinisch 2019-08-29 08:29:04 UTC
This bug needs a change in the word boundaries definition in https://opengrok.libreoffice.org/xref/core/i18npool/source/breakiterator/data/ 

However, if we change the word boundaries definition it affects LO SW, CALC, etc. as well, and there the behaviour of not selecting an underscore or low line is correct. 

Any other programming IDE selects the underscore if you double click.

Another way is to expand the selection in https://opengrok.libreoffice.org/xref/core/vcl/source/edit/textview.cxx?r=c7ea7664#752 if the String contains an underscore till some whitespace appears.
Comment 10 Andreas Heinisch 2020-01-12 14:28:38 UTC
https://gerrit.libreoffice.org/c/core/+/86597/
Comment 11 Commit Notification 2020-02-11 16:41:20 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/992c2e82e29ed68e40fe61303d16762604003121

tdf#57879 - Expand word boundaries to include connector punctuations

It will be available in 7.0.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.