Enum LayoutMode
The layout mode.
Declaration
public enum LayoutMode
Fields
Name | Description |
---|---|
Default |
The default layout mode, with one line of lookahead |
Simple |
A fast-and-ugly layout mode. Tells the layout engine not to collapse any line breaks and to ignore all indentation and annotations. The resulting text contains fewer characters than the Default mode, so may be appropriate for machine-readable output in indentation-insensitive contexts. |
Smart |
A "smart" layout mode, which can produce better layouts than Default under certain circumstances, at the expense of some performance. The Default layout mode commits to rendering a Document<T> in a certain way if the rest of the current line fits within the page width. In other words, the Default layout mode has up to one line of lookahead. However, this lookahead strategy can sometimes produce inefficient layouts when rendering Aligned() blocks. If the first line of an aligned block fits within the page width, the default layout mode commits to rendering the whole aligned block indented to the current column, even if that would cause a line later on in the block to overflow. The Smart layout mode instructs the layout engine to look ahead further than a single line when rendering an aligned block; instead it looks ahead to the first de-indent. This means the smart layout algorithm might take a LineBreakHints preceding an aligned block, if doing so would prevent a line in the aligned block from overflowing. |