Skip to content

Commit

Permalink
Merge pull request #317 from abeMedia/patch-1
Browse files Browse the repository at this point in the history
fix: prevent negative indentation
  • Loading branch information
DotJoshJohnson authored Jul 7, 2020
2 parents 3e20dd0 + 168adc3 commit 343fb2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/formatting/formatters/v2-xml-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class V2XmlFormatter implements XmlFormatter {
}

private _getIndent(options: XmlFormattingOptions, indentLevel: number): string {
return ((options.editorOptions.insertSpaces) ? " ".repeat(options.editorOptions.tabSize) : "\t").repeat(indentLevel);
return ((options.editorOptions.insertSpaces) ? " ".repeat(options.editorOptions.tabSize) : "\t").repeat(Math.max(indentLevel, 0));
}

private _removeTrailingNonBreakingWhitespace(text: string): string {
Expand Down

0 comments on commit 343fb2c

Please sign in to comment.