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 235181

Summary: Broken SHIFT+ALT+F autoindentation
Product: php Reporter: unai
Component: Formatting & IndentationAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=235239
Issue Type: DEFECT Exception Reporter:

Description unai 2013-08-28 14:47:44 UTC
[ BUILD # : 201308222300 ]
[ JDK VERSION : <1.7.0_21 ]

Following sample code snippet reproduces the issue:

        function bogus($asd) {
            for ($i = 0; $i < $asd; $i++)
                if ($i == 3)//bla bla bla
                    return false; //bla bla
            return $i;
        }

Hitting SHIFT+ALT+F you get

        function bogus($asd) {
            for ($i = 0; $i < $asd; $i++)
                if ($i == 3)//bla bla bla
                    return false; //bla bla
                    return $i;
        }

which is wrong.
On the other hand, if you remove the last comment and invoke autoindetation
again, indentation is applied properly:

        function bogus($asd) {
            for ($i = 0; $i < $asd; $i++)
                if ($i == 3)//bla bla bla
                    return false;
            return $i;
        }
Comment 1 mmolda 2013-08-28 14:52:38 UTC
Reproducible in

Product Version: NetBeans IDE Dev (Build 201308280001)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 2 Ondrej Brejla 2013-12-03 14:33:26 UTC
Fixed in web-main #08fe3bb7060e