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 - Patch for: Finer granularity would improve select_next_element
Summary: Patch for: Finer granularity would improve select_next_element
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords: PATCH_AVAILABLE
: 113968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-09 03:04 UTC by darogers
Modified: 2014-05-17 04:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


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