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.
Created attachment 110630 [details] Example code Well, there is a problem with indentions when using mix of HTML and PHP code. The example code, formatted by NetBeans, is in attachment. So, some description: we have class MyClass with methods Foo1, Foo2 and Foo3. Foo1 contains html and php, but formatter is OK with it. Foo2 also contains html and php, and here is the bug. You can see extra indents before Foo2's closing brace and also before each row down below. Notice, that sometimes formatter does not add extra braces on first C-S-F pressing, only after second one. But I couldn't precisely reproduce it. Maybe, in this simple example you can hack the bug by inserting some new lines here and there. But I can assure you, it will not work with more complex source codes (to say nothing of some cases, when new lines are unsuitable, e.g. for inline elements). As I can see, the logic of this bug is rather esoteric :). E.g., wrap the body of the Foo2() into another pair of braces and - bang - it will be satisfactory formatted. Or delete one of the <div> elements - the same thing.
Reproducible. The main problem I see in the formating of Foo3 from the example.
(In reply to comment #1) > Reproducible. The main problem I see in the formating of Foo3 from the example. Yes, and don't forget the closing brace of Foo2 and the closing brace of the MyClass class itself, please. Thus, every line after Foo2 will have extra indents. And closing PHP tag (correctly formatted in the Example) may also be wrongly moved to the right (see Example 2. Main differences are on 19th and 20th lines).
Created attachment 110723 [details] Example 2
*** Bug 190652 has been marked as a duplicate of this bug. ***
Sorry but this is - IMHO - very unusual use (misuse? ;) of PHP and HTML. I mean to end PHP block inside of a declaration (of a method or a function). IMHO you should really prefer to use variables and "echo" function, e.g.: function header($title) { echo '<h1>' . $title . '</h1>'; } Thanks for reporting.
*** This bug has been marked as a duplicate of bug 257574 ***