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 172117 - Else if incorrectly auto formatted depending on spelling
Summary: Else if incorrectly auto formatted depending on spelling
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-09-13 21:47 UTC by jlindenbaum
Modified: 2009-09-14 10:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Expected else if after formatting (15.34 KB, image/png)
2009-09-13 21:48 UTC, jlindenbaum
Details
Incorrect else if after formatting (15.50 KB, image/png)
2009-09-13 21:48 UTC, jlindenbaum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jlindenbaum 2009-09-13 21:47:38 UTC
Tested XP 6.7 and 6.7.1, Mac OS X 10.5.5/10.5.6 with 6.7 and 6.7.1.

When auto formatting script if the operation comes across and "elseif" (no space) branch it indents correctly. On the other hand if the operation comes 
across "else if" (space) it will incorrectly nest the operation and curly brace of that else if.

Images should be attached, text example first:

	public function netBeansBug()
	{
		if ($condition === TRUE)
		{
			// do this
		}
		else if ($condition === TRUE)
		{
			// do that
		}
	}

After running the auto format operation it's incorrecly indented to: (Please note that I've filed a separate bug for the comment misplacements here 
#172116 )

	public function netBeansBug()
	{
		if ($condition === TRUE)
		{
		// do this
		}
		else if ($condition === TRUE)
			{
			// do that
			}
	}
Comment 1 jlindenbaum 2009-09-13 21:48:12 UTC
Created attachment 87570 [details]
Expected else if after formatting
Comment 2 jlindenbaum 2009-09-13 21:48:42 UTC
Created attachment 87571 [details]
Incorrect else if after formatting
Comment 3 Tomasz Slota 2009-09-14 10:06:12 UTC

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