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 143745 - Double click selecting a bracket/brace selects a block of code
Summary: Double click selecting a bracket/brace selects a block of code
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-13 11:25 UTC by qbeukes
Modified: 2013-12-07 17:55 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qbeukes 2008-08-13 11:25:59 UTC
Take these 2 concepts to mind

(1) When selecting a bracket "[", parentheses "(", brace "{", or quotes "/' the other one of the pair is highlighted.
Netbeans doesn't do the quote highlighting, but that is a completely different issue. Also, if the last character on the
line is one of these, then clicking anywhere past that character obviously also highlights it, the feature request
includes double clicking in this area (as well as on the character itself).
(2) When you double click on a word it highlights the whole word.

So the feature request is this:
When you double click on a bracket, it selects it's whole enclosed block of code.

So single clicking on this bracket, or anywhere past it if it's the last character on the line, highlights both. But
double clicking selects the whole block of code. 

Sample:
public void demo()
{
  // this will also be selecting, including both the brackets.
}

Sample 2:
if ((selecting this inner bracket will have me selected) && (and not me))
{
}

I'm sure you can see the benefit in this. Take a look at the Eclipse Java editor to get a feel for it.

Also, it can be changed to triple clicking, though a triple click will remove the "whole line" selection in cases like
Sample 2, which you might still want. So in sample 2 a single click on any bracket will highlight it's significant
other, a double click on the first inner bracket will select the first sub expression, same for the second inner, and
the outer, a triple click will select the whole line.
Comment 1 mithun_gonsalvez 2013-12-07 17:55:58 UTC
Note: Double clicking the beginning or ending double-quote of a String will select the whole String

String A = "double clicking the beginning or ending double-quote will select this block " + "but not this one";