Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 166399 - Comments on the first line of a block of instructions
Comments on the first line of a block of instructions
Status: RESOLVED DUPLICATE of bug 162320
Product: php
Classification: Unclassified
Component: Editor
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Tomasz Slota
issues@php
:
Depends on:
Blocks:
  Show dependency treegraph
 
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
:


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 ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo