mirror of
https://github.com/beautifier/js-beautify.git
synced 2025-01-31 09:52:17 +00:00
Reset line length count only when actually wrapping
This commit is contained in:
parent
6ed2116c4c
commit
35dc66afa3
@ -952,11 +952,11 @@ function Beautifier(html_source, options, js_beautify, css_beautify) {
|
||||
}
|
||||
|
||||
this.print_newline = function(force, arr) {
|
||||
this.line_char_count = 0;
|
||||
if (!arr || !arr.length) {
|
||||
return;
|
||||
}
|
||||
if (force || (arr[arr.length - 1] !== '\n')) { //we might want the extra line
|
||||
this.line_char_count = 0;
|
||||
if ((arr[arr.length - 1] !== '\n')) {
|
||||
arr[arr.length - 1] = rtrim(arr[arr.length - 1]);
|
||||
}
|
||||
|
@ -804,11 +804,11 @@ function Beautifier(html_source, options, js_beautify, css_beautify) {
|
||||
}
|
||||
|
||||
this.print_newline = function(force, arr) {
|
||||
this.line_char_count = 0;
|
||||
if (!arr || !arr.length) {
|
||||
return;
|
||||
}
|
||||
if (force || (arr[arr.length - 1] !== '\n')) { //we might want the extra line
|
||||
this.line_char_count = 0;
|
||||
if ((arr[arr.length - 1] !== '\n')) {
|
||||
arr[arr.length - 1] = rtrim(arr[arr.length - 1]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user