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.
[ JDK VERSION : <1.7.0_21 ] Use the following code snippet to reproduce: if ($out[0] != "null")// $this->popupAbortente($out, "Riga $i:");// TODO funzione //2c II unset($out); If you hit SHIFT-ALT-F to invoke autoindentation, an extra blank line is added in the middle. If you do that again, another blank line is added, and so on forever. So if you have a similar piece of code someplace in a big real-world php file, as you shift-alt-F to keep your code tidy through the days, you end up having a pageful of empty lines that got added because of this bug. ACTUAL RESULT: if ($out[0] != "null")// $this->popupAbortente($out, "Riga $i:");// TODO funzione //2c II unset($out); EXPECTED RESULT: if ($out[0] != "null")// $this->popupAbortente($out, "Riga $i:");// TODO funzione //2c II unset($out); OR if ($out[0] != "null")// $this->popupAbortente($out, "Riga $i:");// TODO funzione //2c II unset($out); or something like that.
Sorry, but I can't reproduce that. Maybe your pasted code is somehow modified, so attach a sample file. Thanks. Product Version: NetBeans IDE Dev (Build 20130829-7bb55cb231c0) Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15 System: Linux version 3.8.0-29-generic running on i386; UTF-8; cs_CZ (nb)
Can reproduce in Windows 7, Windows Vista, [K]Ubuntu, CentOS 5 and 6. Please try to do the following: Create a new empty PHP 5.2 project (New Project... | PHP | PHP Application). Leave everything default except for the PHP Version, where you select PHP 5.2/5.1. Open the generated index.php and replace // put your code here with if ($out[0] != "null")// $this->popupAbortente($out, "Riga $i:");// TODO funzione //2c II unset($out); Alt-shift-F and the two couples of lines of code start drifting away from each other.
Now I can reproduce that, thanks.
It works properly if "if" statement uses braces. May be a workaround for you.
And when line comment before unset() is removed, then it works properly as well. That's note for me ;)
Removing "// TODO funzione" or "//2c II" solves the problem...
Simplest case for me: <?php if (true) foo(); //first //second bar();
Bug #235181 also is about indentation-misbehaviour after a comment; don't know if it's related though.
I mean, after a comment of an unbraced oneliner in an if block :)
Hm, but it's a bit different issue. But same crap :)) I hate fixing formatter, it's a genuine hate ;)
I just tried it on windows 8 and it happens to me too. Product Version: NetBeans IDE Dev (Build 201308270854) Updates: Updates available Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
Yes it will since it's platform independant ;)