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 241359 - Improper Brace Matching
Summary: Improper Brace Matching
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-03 21:04 UTC by az.pengwang
Modified: 2014-04-22 16:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen capture of the sample code (2.74 KB, image/png)
2014-02-03 21:04 UTC, az.pengwang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description az.pengwang 2014-02-03 21:04:33 UTC
Created attachment 144750 [details]
screen capture of the sample code

It happens when part of the brace is a conditional code as below (also as attached). There is also an auto-indenting problem as you can see.

void test(void)
{
#if 1
    if (1) {
#else
	if (0) {
#endif
	}
}
Comment 1 Vladimir Voskresensky 2014-02-10 11:40:38 UTC
Confirmed. Indenter doesn't work correctly.

While formatter works fine for such cases. 
For now you can use workaround: select your text and reformat it.
Comment 2 Alexander Simon 2014-02-10 11:44:30 UTC
fixed brace patcing part, change set:
http://hg.netbeans.org/cnd-main/rev/73d8c5d6ee8b
Comment 3 Quality Engineering 2014-02-11 02:54:53 UTC
Integrated into 'main-silver', will be available in build *201402110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/73d8c5d6ee8b
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing Bug 241359 - Improper Brace Matching
- brace matcing part