Bug 189810 - 'else' is not auto-indented correctly.
'else' is not auto-indented correctly.
Status: RESOLVED DUPLICATE of bug 188112
Product: editor
Classification: Unclassified
Component: Formatting & Indentation
6.x
PC Windows XP
: P3 (vote)
: 7.0
Assigned To: Dusan Balek
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-24 15:19 UTC by peterhull90
Modified: 2010-10-15 16:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description peterhull90 2010-08-24 15:19:38 UTC
Product Version = NetBeans IDE 6.9 (Build 201006101454)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_18
Runtime = Java HotSpot(TM) Client VM 16.0-b13

When typing java code containing if...else..., the 'else' is indented close to the left margin and not under the 'if'. I think this is new in 6.9.

Example:
Type
public class Dummy {
	public Dummy() {
		if (true) {
			
		}
 		els^
	}
}
The caret is at ^. 
Type the final e of else and the word jumps to the left margin
public class Dummy {
	public Dummy() {
		if (true) {
			
		}
 else
 
	}
}
Complete the structure and choose Source|Format. The code is indented 'correctly'
public class Dummy {

	public Dummy() {
		if (true) {
		} else {
		}

	}
}

Reproducible always.
Comment 1 Dusan Balek 2010-10-15 16:39:56 UTC
Should be already fixed in the current dev build.

*** This bug has been marked as a duplicate of bug 188112 ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo