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 178210 - [indentation] wrong indentation of brackets when set "on new line"
Summary: [indentation] wrong indentation of brackets when set "on new line"
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-06 21:11 UTC by dzero
Modified: 2013-03-07 21:01 UTC (History)
1 user (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 dzero 2009-12-06 21:11:52 UTC

    
Comment 1 dzero 2009-12-06 21:14:56 UTC
code does not format properly while typing

conditional statements not indenting properly

when i type 

for()
   {
}

it indents my bracket as shown

if i format the code using format

it looks correct

for()
{
}
Comment 2 Filip Zamboj 2009-12-07 05:51:47 UTC
@reporter: I assume you set the braces indentation to new line after statement. 

reproduced in Product Version: NetBeans IDE 6.8 RC2 (Build 091203-93714f910393)
1. type 
if ($a == 50) | 
2. press enter 
if ($a == 50)
    | 
3. write bracket and press enter 
if ($a == 50)
    { 
    |
} 
 
case with for is reproducible only if you don't provide arguments, e.g. 'for ()' is indented incorrectly but 'for ($i=10;$i<40;$i++)' is indented correctly.

@ppisl: do you agree to have this in 68patch1? Thanks.
Comment 3 Petr Pisl 2009-12-07 06:16:15 UTC
yes, i agree
Comment 4 maverick530 2010-10-15 17:38:17 UTC
This is still an issue for 6.9.1. I can't stand how my formatting settings are set correctly, but when I type, it auto-indents my curley brace { after returning from my if statements, for example.
Comment 5 Petr Pisl 2011-04-07 14:48:24 UTC
The behavior in NB  7.0 is different and I think that it's right now. If you don't agree, please reopen.
Comment 6 magickgardener 2013-03-07 20:59:45 UTC
Thanks for fixing the issue. I'm also posting to report that bug 178542 and 187727 should probably have been marked as duplicates of this one. I know they're all closed but updating their status would slightly clean up the hatch.
Comment 7 magickgardener 2013-03-07 21:01:22 UTC
(In reply to comment #6)
> 187727

Sorry I meant bug 187727.