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

Summary: Autoformatting fails on complex angular filter
Product: editor Reporter: usernamex12j1532jk
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

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.