Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unindent_chained_methods broken #1533

Closed
gaby64 opened this issue Sep 4, 2018 · 2 comments
Closed

unindent_chained_methods broken #1533

gaby64 opened this issue Sep 4, 2018 · 2 comments

Comments

@gaby64
Copy link

gaby64 commented Sep 4, 2018

Latest release breaks unindent_chained_methods

if I have the time, I will update this issue to follow the guidelines

@bitwiseman
Copy link
Member

bitwiseman commented Sep 4, 2018

@gaby64

Breaks how? Creating a bug using https:/beautifier.io takes less than 5 minutes.
Set your beautifier, add "unindent_chained_methods": true to the JSON box, paste in your input, click beautify, and then click the button below the input to submit a bug.

At the very least, we need an input.

@gaby64
Copy link
Author

gaby64 commented Sep 4, 2018

Input

The code looked like this before beautification:

angular.module('test').controller('testCtrl', function($scope) {
	$scope.tnew;
	$scope.toggle_tnew = function() {
		$scope.mode = 0;
		if(!$scope.tnew) {
			$scope.tnew = {};
		} else $scope.tnew = null;
	}
	$scope.fn = function() {
		return null;
	}
});

Current Output

The code actually looked like this after beautification:

angular.module('test').controller('testCtrl', function($scope) {
$scope.tnew;
$scope.toggle_tnew = function() {
$scope.mode = 0;
if (!$scope.tnew) {
	$scope.tnew = {};
} else $scope.tnew = null;
}
$scope.fn = function() {
return null;
}
});

Expected Output

The code should have looked like this after beautification:

/*Adjust the code to look how you prefer the output to be.*/
angular.module('test').controller('testCtrl', function($scope) {
	$scope.tnew;
	$scope.toggle_tnew = function() {
		$scope.mode = 0;
		if(!$scope.tnew) {
			$scope.tnew = {};
		} else $scope.tnew = null;
	}
	$scope.fn = function() {
		return null;
	}
});

Environment

Browser User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Language Selected:
Auto Detect

Settings

Example:

{
  "indent_size": "1",
  "indent_char": "\t",
  "max_preserve_newlines": "5",
  "preserve_newlines": true,
  "keep_array_indentation": false,
  "break_chained_methods": false,
  "indent_scripts": "normal",
  "brace_style": "collapse",
  "space_before_conditional": true,
  "unescape_strings": false,
  "jslint_happy": false,
  "end_with_newline": false,
  "wrap_line_length": "0",
  "indent_inner_html": false,
  "comma_first": false,
  "e4x": false,
  "unindent_chained_methods": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants