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 20568 - Editor indents curly braces incorrectly after if, for, while
Summary: Editor indents curly braces incorrectly after if, for, while
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Lexer (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-14 20:09 UTC by jmorgan
Modified: 2002-07-19 15:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmorgan 2002-02-14 20:09:56 UTC
Using Netbeans version 3.1.1, build 200202011224, on JDK 1.3.1_02.

I prefer the following placement of curly braces for if, while, etc.:

for ( int i = 0; i < x; i++ )
{
}

When entering one of these statements into Netbeans, after entering an if, for, 
or while statement's first line, I press enter to go to the next line, and it 
indents four spaces (my defined tab-width) past the start of the statement.  
Then:

- In previous versions of Netbeans, I would simply enter a left curly-brace, 
and the editor would jump to the column directly beneath the first character of 
the preceding statement and place the curly-brace there (so that it matched the 
formatting example above).

- In 3.3.1, I enter the curly-brace, and the editor automatically moves the 
cursor one character from the left border of the screen, no matter where the 
first character of the statement in the line before it is, and places the curly-
brace there.  The code then looks like the following:
        if ( int i = 0; i < x; i++ )
 {

How can I make it work the old way?
Comment 1 jmorgan 2002-02-18 20:40:02 UTC
Oops.  Using Netbeans version 3.3.1, not 3.1.1.
Comment 2 Miloslav Metelka 2002-07-09 11:54:30 UTC
This works correctly in recent builds.