Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 178542 - Wrong indentation when using new line for braces placement.
Wrong indentation when using new line for braces placement.
Product: php
Classification: Unclassified
Component: Formatting & Indentation
All All
: P2 with 1 vote (vote)
: 6.x
Assigned To: Petr Pisl
: 178739 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2009-12-13 12:51 UTC by freshapple
Modified: 2013-08-29 12:23 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description freshapple 2009-12-13 12:51:34 UTC
I use Allman indent style. In Settings/Editor/Formatting I set braces placement for php to "New line". But actually this option affects only on source format feature. 
Actual wrong indentation results:
foreach($zzz as $zzzz)
Expected Results:
foreach($zzz as $zzzz)
This bug occurs on all block operators such: for, foreach, if, do, while...
Doesn't occur in Netbeans 6.7
Comment 1 maghiel 2009-12-13 13:36:13 UTC
I'm having the same issue too and it's really annoying!
Netbeans 6.8 - Windows 7 Ultimate
Comment 2 Filip Zamboj 2009-12-14 07:04:16 UTC
well, this issue is reproducible. 

@peter: I guess this is a bit unpleasant because I can write something like 

if (true) //enter
    and one command 

as well as 

if (true) //enter 


is there any way to do something about this? thanks.
Comment 3 Petr Pisl 2009-12-14 07:27:19 UTC
I think the behavior should be:

When you 
if (true)|

and press Enter on | position the result will be still

if (true)

and when now press '{' then the result will be

if (true)

and now press enter the result will be

if (true)
Comment 4 Filip Zamboj 2009-12-14 08:01:23 UTC
yep, that's how it should be. if there would be opening bracket automatically indented it would be great.
Comment 5 Petr Pisl 2009-12-15 10:15:46 UTC
I put the fix for this issue into the web-main. 

It's change 155808:a3a0f0d7676d
Comment 6 Filip Zamboj 2009-12-16 02:11:50 UTC
verified, can be transplanted to 68patch1
Comment 7 pgebauer 2009-12-16 06:58:24 UTC
The fix has been ported into the release68_fixes repository.
Comment 8 Quality Engineering 2009-12-17 00:12:46 UTC
Integrated into 'main-golden', will be available in build *200912170200* on (upload may still be in progress)
User: Petr Pisl <>
Log: issue #178542 - Wrong indentation when using new line for braces placement.
Comment 9 Filip Zamboj 2009-12-17 01:05:08 UTC
*** Bug 178739 has been marked as a duplicate of this bug. ***
Comment 10 Filip Zamboj 2010-01-27 07:23:42 UTC
Product Version: NetBeans IDE 6.8 (Build 201001261800)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
Comment 11 magickgardener 2013-03-07 20:51:24 UTC
(In reply to comment #10)
> verified 
> Product Version: NetBeans IDE 6.8 (Build 201001261800)

Apparently the bug was back in version 6.9. According to bug 178210 it was really fixed in version 7.0.

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