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 146602

Summary: Patch for: Finer granularity would improve select_next_element
Product: java Reporter: darogers <darogers>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: blocker CC: cjkent
Priority: P3 Keywords: PATCH_AVAILABLE
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Proposed patch

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
inclusion.
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.

http://hg.netbeans.org/jet-main/rev/7bec088a5b52
Comment 4 Quality Engineering 2014-05-17 04:33:52 UTC
Integrated into 'main-silver', will be available in build *201405170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7bec088a5b52
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #146602 - Patch for: Finer granularity would improve select_next_element - applied.