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 166399

Summary: Comments on the first line of a block of instructions
Product: php Reporter: testerro <testerro>
Component: EditorAssignee: Tomasz Slota <tslota>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: pjiricka
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description testerro 2009-06-02 12:58:35 UTC
If a comment is on the first line of a block of instructions, the Source | Format function behaves incorrectly. Consider
the following example:

<?php
$x = 0;
if($x==1) {
  // the first comment
  $x = 2;
  // the second comment
  $x = 3;
}

function test($y) {
  // another comment
  return $y;
}
?>

After using the Source | Format function, it gets reformatted as:

<?php
$x = 0;
if($x==1) {
// the first comment
  $x = 2;
  // the second comment
  $x = 3;
}

function test($y) {
// another comment
  return $y;
}
?>

The first comment should get indented as the rest of the body of a function or a block of code. 

Also, the Source | Format function works for some reason WAY slower than just pressing ALT+SHIFT+F in the editor. 

I'm using Netbeans 6.7 RC1.
Comment 1 Tomasz Slota 2009-06-02 13:53:18 UTC

*** This issue has been marked as a duplicate of 162320 ***