mirror of
https://github.com/beautifier/js-beautify.git
synced 2025-02-20 05:02:02 +00:00
Merge pull request #171 from mcongrove/master
Stops keep_array_indentation from overwriting tabs with spaces
This commit is contained in:
commit
11ebb70da8
20
beautify.js
20
beautify.js
@ -380,12 +380,14 @@ function js_beautify(js_source_text, options) {
|
||||
just_added_newline = true;
|
||||
whitespace_count = 0;
|
||||
} else {
|
||||
if (c === '\t') {
|
||||
whitespace_count += 4;
|
||||
} else if (c === '\r') {
|
||||
// nothing
|
||||
} else {
|
||||
whitespace_count += 1;
|
||||
if (just_added_newline) {
|
||||
if (c === indent_string) {
|
||||
output.push(indent_string);
|
||||
} else {
|
||||
if (c !== '\r') {
|
||||
output.push(' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -398,12 +400,6 @@ function js_beautify(js_source_text, options) {
|
||||
|
||||
}
|
||||
|
||||
if (just_added_newline) {
|
||||
for (i = 0; i < whitespace_count; i++) {
|
||||
output.push(' ');
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
while (in_array(c, whitespace)) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user