Merge pull request #171 from mcongrove/master

Stops keep_array_indentation from overwriting tabs with spaces
This commit is contained in:
Einar Lielmanis 2013-01-29 19:28:39 -08:00
commit 11ebb70da8

View File

@ -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)) {