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 167082 - Auto formating creates wrong indentation on "else if"
Summary: Auto formating creates wrong indentation on "else if"
Status: RESOLVED DUPLICATE of bug 164381
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-15 09:01 UTC by radalin
Modified: 2009-08-18 13:04 UTC (History)
0 users

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 radalin 2009-06-15 09:01:57 UTC
I have encountered this on:
Product Version: NetBeans IDE 6.7 RC2 (Build 200906042131)
Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02
System: Windows Vista version 6.0 running on x86; Cp1254; tr_TR (nb)

(copy paste from about part)

Let's say I have a code like this:

if ($condition) {
    doSomething();
} else if ($condition2) {
   doSomethingAgain();
} elseif ($condition3) {
  doAnything();
} else {
    raiseError();
}

The Indents are not written good, so I select all this code block and right click and select format, the formatting
occurs like this:


if ($condition) {
    doSomething(); //Indented 4 spaces or one tab
} else if ($condition2) {
        doSomethingAgain(); //Indented 8 spaces or two tabs
} elseif ($condition3) {
    doAnything(); //Indented 4 spaces or one tab
} else {
    raiseError();
}

"else if" part acts like: 

else
    if ($condition2) {
        $doSomethingAgain();
    }

But it does not put the if condition on a second line. Instead it should act like "elseif", where the indentation occurs
as expected.
Comment 1 Tomasz Slota 2009-08-18 12:39:20 UTC

*** This issue has been marked as a duplicate of 170541 ***
Comment 2 Tomasz Slota 2009-08-18 12:40:47 UTC
Marked as a duplicate of wrong issue, reopening
Comment 3 Tomasz Slota 2009-08-18 13:04:15 UTC

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