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 178542 - Wrong indentation when using new line for braces placement.
Summary: Wrong indentation when using new line for braces placement.
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 178739 (view as bug list)
Depends on:
Blocks:
 
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
Exception Reporter:


Attachments

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

http://hg.netbeans.org/web-main/rev/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.
http://hg.netbeans.org/release68_fixes/rev/9a4d517817b2
Comment 8 Quality Engineering 2009-12-17 00:12:46 UTC
Integrated into 'main-golden', will be available in build *200912170200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a3a0f0d7676d
User: Petr Pisl <ppisl@netbeans.org>
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
verified 
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.