-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make empty arrays and dictionaries render compactly even when indent …
…> 0 (#501) Fixes #499 We take a similar strategy as we do for adding commas: rather than calling `renderIndent` immediately after opening a new array/dict and at `visitEnd`, we instead set an `indentBuffered` flag and defer the `renderIndent` until later. Then each `flushBuffer` call can render the indent where necessary, and `visitEnd` can perform some additional checks that the collection is not empty before rendering the final indent Added some basic tests to `ExampleTests.scala`, since some of this behavior is probably worth showing to users in the documentation
- Loading branch information
Showing
2 changed files
with
35 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters