This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197253

Summary: Extend behaviour of CamelCase to underscore entities as well
Product: editor Reporter: normadize
Component: NavigationAssignee: Jan Becicka <jbecicka>
Status: CLOSED INVALID    
Severity: normal CC: markiewb
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Example of underscore caret navigation

Description normadize 2011-03-31 00:44:12 UTC
Hi Petr,

It would be nice if the CamelCase behaviour of the editor (ctrl+left/right, ctrl+del, ctrl+backspace etc) was extended to support underscore_defined_words as well :). Many devs, myself included, use underscores for things like constants or plain variables and StudlyCaps/CamelCase for classes, methods and objects.

Bogdan
Comment 1 markiewb 2013-01-14 19:19:17 UTC
Created attachment 130202 [details]
Example of underscore caret navigation
Comment 2 johnnybaloney 2015-08-13 15:05:44 UTC
NetBeans IDE 8.0.2 (Build 201411181905)

In the following example the places where underscores are recognised as word separators are the VAR_FOO_BAR variable name and the BOO_HOO part of the method name. Interestingly "FOO_BAR" string is treated as one word.

<pre>
    private void test_foo_bar_BOO_HOO() {

        String var_foo_bar = "foo_bar";
        var_foo_bar += "foo_bar";

        String VAR_FOO_BAR = "FOO_BAR";
        VAR_FOO_BAR += "FOO_BAR";
    }
</pre>
Comment 3 johnnybaloney 2015-08-13 15:25:09 UTC
Another bit of rationale behind this request. I personally tend to write test method names using snake case rather than camel case because they are often long and:

testMethodNameWrittenLikeThisIsReallyHardToRead

whereas:

test_method_name_like_this_even_though_very_long_reads_like_a_breeze

Being able to jump between words when using snake case would be very helpful for me here.
Comment 4 kwfinken 2015-08-13 19:45:46 UTC
I would appreciate this option as well.  Many of the programs I work on were developed with an _ as the standard way of separating words, it would make things much easier, without harming any other users.  Should be fairly easy to implement.
Comment 5 kwfinken 2015-09-01 20:22:59 UTC
the underscore notation is used extensively in Drupal programming.  Netbeans is gaining a reputation in this community, but it could be hindered if people find this frustrating.
Comment 6 Martin Balin 2016-07-07 07:26:55 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 7 markiewb 2016-07-10 18:08:30 UTC
Still valid in 8.2 dev 
Product Version: NetBeans IDE Dev (Build 201607100002)
Comment 8 Christian Lenz 2018-02-15 17:21:54 UTC
I will close it, because it will handled now at the JIRA board: https://issues.apache.org/jira/browse/NETBEANS-397. Please discuss it there for further information.

Maybe as a subticket or so.