struct

Mint::Formatter::Group

Inherits Struct < Value < Object

Describes a group of nodes, with start and end characters and a separator character (or characters). The layout of the nodes are determined during rendering based on the behavior:

BreakAll:

  • If the whole group fits in the remaining space in the line (current cursor position plus the size of the group) it will use a space as a delimiter.

  • Otherwise the delimiter will include a line-break and the nodes will be laid out in separate lines indented by an extra level. The start character is on the original line and the end character in it's own extra line.

BreakNotFits:

  • If the whole group fits in the remaining space in the line (current cursor position plus the size of the group) it will use a space as a delimiter.

  • Otherwise the elements that would not extend beyond the current line are broken down into a new indented line and so forth...

Block:

  • The group is always broken into a nested layout, separators are not indented.

Constructors

new(ends : Tuple(String, String), items : Array(Nodes), behavior : Behavior, separator : String, pad : Bool, comment : Nodes = [] of Node)
Source

Instance methods

behavior
clone
Source
comment
copy_with(ends _ends = @ends, items _items = @items, behavior _behavior = @behavior, separator _separator = @separator, pad _pad = @pad, comment _comment = @comment)
Source
ends
items
pad
separator