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 269096 - Autoformatting fails on complex angular filter
Summary: Autoformatting fails on complex angular filter
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-23 21:19 UTC by usernamex12j1532jk
Modified: 2016-11-23 21:19 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 usernamex12j1532jk 2016-11-23 21:19:23 UTC
Create an html file, paste in the following:

    <table class="">
	<tr 
		ng-repeat="item in items| filter:{ 
				f1: (filters:f1 || ''), 
				f2: (filters:f2 || ''), 
				f3: (filters:f3 || '')}"
		>
	</tr>
    </table>
    <script type="text/javascript">
	(function () {
		function foo() {
			$x = 2;
		}
	})(jQuery);
    </script>

Run autoformat and all the javascript is left justified instead of being indented correctly.

Remove one line so your text is like this:

    <table class="">
	<tr 
		ng-repeat="item in items| filter:{ 
				f1: (filters:f1 || ''), 
				f3: (filters:f3 || '')}"
		>
	</tr>
    </table>
    <script type="text/javascript">
	(function () {
		function foo() {
			$x = 2;
		}
	})(jQuery);
    </script>

and now the autoformatting works correctly.