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 196519 - PHP formatter adds extra indentation tabs to embedded HTML *text* with each Format command
Summary: PHP formatter adds extra indentation tabs to embedded HTML *text* with each F...
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.0
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on: 197204
Blocks:
  Show dependency tree
 
Reported: 2011-03-09 20:48 UTC by vezea
Modified: 2011-04-06 12:14 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 vezea 2011-03-09 20:48:50 UTC
When using tab indentation in PHP ("Expand Tabs to Spaces" is *not* checked), each Format command adds extra tabs to indentation for embedded HTML.  This only seems to affect non-whitespace TEXT nodes within the embedded HTML tree.

Note:  This does *not* appear to be an issue when spaces are used for indentation.

Simple example:

1. Create a new PHP file with the following content:

<html>
    <body>
		<?php
			if (true) {
				?>
				<p>
					This text keeps getting indented with each auto-format.
				</p>
				<p>
					<span>This text stays put.</span>
					But this line does not because of the leading newline.
				</p>
				<?php
			}
		?>
	</body>
</html>

2. Make sure "Expand Tabs to Spaces" is not checked.

3. Run PHP formatter (Source->Format) two or more times to see buggy behavior.

----

Other PHP Formatting "Tabs and Indents" settings in use:

Number of Spaces per Indent: 4
Tab Size: 4
Right Margin: 80
Line Wrap: After Words
Initial Indentation: 4
Continuation Indentation: 4
Array Declaration Indentation: 4
Comment 1 Petr Pisl 2011-03-29 15:41:10 UTC
I can reproduce it. The text in paragraph are shifted to the right.
Comment 2 Petr Pisl 2011-03-29 15:41:48 UTC
The marking as fixed was a mistake. :)
Comment 3 Petr Pisl 2011-03-29 17:08:27 UTC
The problem is in HTML formatter. For some reason in this case it doesn't format the lines without a tag. I created for it new issue #197204.
Comment 4 Petr Pisl 2011-04-06 12:14:32 UTC
Fixed in web main.