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 185001 - "New Line Indented" not working
Summary: "New Line Indented" not working
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-26 13:52 UTC by MBRovigo
Modified: 2012-11-17 02:42 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 MBRovigo 2010-04-26 13:52:17 UTC
The Language: PHP > Category: Braces > "New line indented" is supposed to format like this (as shown in the preview code on the right):

whatever
<indent>{
<indent>...
<indent>}

But in practice it acts like this:

whatever
<indent>[the cursor correctly starts here]

Then you hit "{" and Enter and it becomes like this:

whatever
{
<indent>[cursor here]
}
Comment 1 Filip Zamboj 2010-04-29 15:28:37 UTC
reproduced 
Product Version: NetBeans IDE Dev (Build 100429-c5711a1eb6ab)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

type 
while (true) | //enter 

while (true) 
    | //correct 


while (true) 
    {| // { bracket jumps to the first column of the row

while (true) 
{
    | 
}


if you invoke formatting you will get correct indentation 
while (true) 
    { 
    |
    } 


@reporter: correct me if I didn't really get what you meant.
Comment 2 MBRovigo 2010-04-29 15:40:22 UTC
Yes, that was exactly what I meant, and yes, invoking formatting will correct it afterwards.

Thanks!
Comment 3 Quality Engineering 2010-05-01 05:17:46 UTC
Integrated into 'main-golden', will be available in build *201005010200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 4 Petr Pisl 2010-05-03 09:01:24 UTC
I have fixed this on Friday.
Comment 5 Filip Zamboj 2010-05-03 12:48:13 UTC
indentation is still not ok. 
Product Version: NetBeans IDE Dev (Build 100503-2daaf2ae8a4f)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

<?

while (true) 
    { //enter 

result 
while (true) 
    {
    //enter 
}

expected: 
while (true) 
    { 
    //enter 
    }
Comment 6 Petr Pisl 2011-09-26 13:41:22 UTC
The problem is still there.
Comment 7 Ondrej Brejla 2012-05-02 09:40:57 UTC
Still valid.

Product Version: NetBeans IDE Dev (Build 20120502-3fa1de339d64)
Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02
System: Linux version 3.0.0-17-generic-pae running on i386; UTF-8; cs_CZ (nb)
User directory: /home/warden/userdir
Cache directory: /home/warden/userdir/var/cache
Comment 8 Ondrej Brejla 2012-11-16 14:49:45 UTC
Fixed in web-main #56e38483398c
Comment 9 Quality Engineering 2012-11-17 02:42:10 UTC
Integrated into 'main-golden', will be available in build *201211170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/56e38483398c
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #185001 - "New Line Indented" not working