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 241118 - Wrong auto-format in HTML+Latte
Summary: Wrong auto-format in HTML+Latte
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Latte (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-29 13:35 UTC by zener
Modified: 2014-03-06 08:42 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 zener 2014-01-29 13:35:55 UTC
I use Latte template and there is a problem with auto-formatting (Alt+Shift+F). It formats code wrong.

Correct formatting - http://pasteboard.co/hEfiwOX.png
NB formatting (wrong) - http://pasteboard.co/hE6fHYa.png
Comment 1 Vladimir Riha 2014-01-29 14:19:46 UTC
The same "mixed" code works in jsp with EL and scriptlet, so probably issue in Latte editor? Reassigning

Basic case that fails is this:

<script type="text/javascript" n:dd="1">
    function test() {

            }
</script>


in HTML/JSP, the closing } has the same indentation as function keyword (also everything before } has white background, should be green - the same is visible on the screenshots)



Product Version: NetBeans IDE Dev (Build 201401290001)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b66
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b125
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 zener 2014-01-29 20:38:17 UTC
Just another example - http://pasteboard.co/i5NkE8Q.png

Testing source code of example is here: http://pastebin.com/kjhL8rKH
Comment 3 Ondrej Brejla 2014-02-03 12:17:13 UTC
Fixed in web-main #91c92a305b79
Comment 4 Quality Engineering 2014-02-04 03:06:20 UTC
Integrated into 'main-silver', will be available in build *201402040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/91c92a305b79
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #241118 - Wrong auto-format in HTML+Latte
Comment 5 mmolda 2014-02-04 12:57:56 UTC
Verified. Thanks.

Product Version: NetBeans IDE Dev (Build 201402040001)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b67
Runtime: Java(TM) SE Runtime Environment 1.8.0-b126
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 6 zener 2014-03-06 08:42:58 UTC
I downloaded NetBeans 8.0 RC1 and there is the same problem. I think it's a little bit better but still auto-formatting is not working well.

Here is an example (after auto-format):
http://pasteboard.co/1a6bvvJX.png

And source code:
http://pastebin.com/NDFQxuKa