Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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