Skip to content

How to print curly brace if it doesn't fit? #628

@steinybot

Description

@steinybot

I would like to do:

def foo = bar

if it fits, otherwise do:

def foo = {
  bar
}

Is this possible?

Seems like I need FlatAlt("{" +: Doc.hardLine, doc) but there is no way to create a custom FlatAlt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions