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.
[please evaluate and lower priority if not important. thanks. below is snippet from my announcement of HTML/JSP/CSS indentation rewrite] Ruby and PHP formatters relied on behavior of old HTML formatter which indented all lines regardless if they start with html or not and Ruby/PHP would then just further adjust indentation of some lines. This is completely different now: one of the rules I set for rewrite of HTML formatter was that formatter touches only lines which belongs to it: if line start with an HTML tag then it will be indented by HTML indenter; if not then it's a job of formatter of the language of that line. For now I resolved this by storing Map<line-number, suggested-indentation> in document's properties. This is done by HTML (or CSS or JSP) formatter and can be reused by Ruby/others to. For Ruby fix was straightforward (de607f2c3cb3) and seems to work. The only problem I'm aware of are failing tests in RhtmlKitTest (testNewline4a , 4b, 5* and 6). These tests worked before but do not work now but I cannot figure out how could it be related to HTML indentation because it is purely Ruby formatter's job (eg. "<% if true %>^\n" should become "<% if true %>\n ^\n"). SImilarly pressing Enter in editor after ruby expression does not indent line properly.
Thanks for the reminder, I had forgotten to look at this.
I had a look at this some time ago, while debugging a 6.5 build it seemed to me that it wasn't really the rhtml indenter that indented this correctly in 6.5; perhaps it got (incorrectly) indented by another indenter before the changes. But that was really my first ever peek into indententation and I may well have misunderstood how it is supposed to work.
RE. "perhaps it got (incorrectly) indented by another indenter" - that's the case. It was indented by HTML formatter despite it being pure Ruby code that HTML formatter knows nothing about. I fixed the HTML formatter to stop doing that. :-) What needs to be done is to simply (though it is faaaar from simple) enhance RHTML formatter to handle all its lines. I will have a look at it again. I originally filed this as P2 just to get early evaluation. If nobody complained about this so far then perhaps it is P3.
Not sure how common it is to have long blocks of Ruby inside RHTML. If it's not that common, I agree this is a P3, especially if noone complained.
David, thanks a lot for the evaluation. I would agree that this is a P3, as far as I can tell the problem is only after inserting the first new line within <% %>, indentation works fine within multiline blocks. So I'm downgrading this for now.
Integrated into 'main-golden', will be available in build *201003170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/5609d79712e3 User: Erno Mononen <emononen@netbeans.org> Log: #160612 related, made the failing test only to report a warning until the issue gets fixed