Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 146602 - Patch for: Finer granularity would improve select_next_element
Patch for: Finer granularity would improve select_next_element
Product: java
Classification: Unclassified
Component: Editor
All All
: P3 with 1 vote (vote)
: 8.0.1
Assigned To: Dusan Balek
: 113968 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2008-09-09 03:04 UTC by darogers
Modified: 2014-05-17 04:33 UTC (History)
1 user (show)

See Also:

Proposed patch (2.80 KB, patch)
2013-06-18 20:57 UTC, markiewb
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description darogers 2008-09-09 03:04:02 UTC
Select next element could be improved with somewhat finer granularity.

1) When the cursor is in a string constant, pressing alt-shift-period (select-next-element) selects the entire string
including the quotes.  It would be nice if the first use of select-next-element would select the string but excluding
the quote characters.  The second use would then include the quote characters too.

2) Currently, if an entire line is selected, the next use of select-next-element select the enclosing block including
the curly braces.  It would be nice if it selected the block but _excluding_ the curly braces.  Then the next level of
Comment 1 markiewb 2013-06-18 20:37:46 UTC
*** Bug 113968 has been marked as a duplicate of this bug. ***
Comment 2 markiewb 2013-06-18 20:57:40 UTC
Created attachment 135995 [details]
Proposed patch

I like to propose a patch to improve the "select next element" action. 

The patch introduces the following changes
* a) support content selection within the string literal too (simple change to copy the IDEA behaviour and even useful): for example "A|BC" -> ABC then "ABC"
* b) support content selection within the {}-block too: for example {A|BC} -> ABC then {ABC} 
* c) don't create line selection for empty selections (makes no sense to select a blank line)

@Dusan: Please review and commit if appropriate. I guess this will be post-7.4. 
IMHO a)+c) are no-brainers. But I don't know whether b) is really neccessary (it was the second requirement in #146602).
Comment 3 Dusan Balek 2014-05-16 07:40:02 UTC
Makes sense. Patch applied. Thank you for your contribution.
Comment 4 Quality Engineering 2014-05-17 04:33:52 UTC
Integrated into 'main-silver', will be available in build *201405170001* on (upload may still be in progress)

User: Dusan Balek <>
Log: Issue #146602 - Patch for: Finer granularity would improve select_next_element - applied.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo