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 - Comments on the first line of a block of instructions
Summary: Comments on the first line of a block of instructions
Status: RESOLVED DUPLICATE of bug 162320
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-02 12:58 UTC by testerro
Modified: 2009-06-02 13:53 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 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 ***