var lastNewlineIndex = 0; while (true) { var nextNewlineIndex = content.indexOf("\n", lastNewlineIndex); if (nextNewlineIndex === -1) { if (content.length - lastNewlineIndex > WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength) this.autoFormat = true; break; } if (nextNewlineIndex - lastNewlineIndex > WebInspector.SourceCodeTextEditor.AutoFormatMinimumLineLength) { this.autoFormat = true; break; } lastNewlineIndex = nextNewlineIndex + 1; }