ktfmt icon indicating copy to clipboard operation
ktfmt copied to clipboard

Feature request: Automatic breaking of very long strings

Open bethcutler opened this issue 4 years ago • 1 comments

When encountering strings that are over (or very near) the character limit, ktfmt makes no attempt to break the strings. Should it?

e.g. This code is not modified in any way, despite the fact that the last line exceeds 100 characters:

  val name
    get() =
      "A very very very long string that probably should be wrapped; should this be done automatically?"

one possible fix:

  val name
    get() =
      "A very very very long string that probably should be wrapped; should this be done " +
        "automatically?"

bethcutler avatar Apr 29 '21 17:04 bethcutler

GJF does iirc, let's find out if we can reuse that code.

cgrushko avatar Apr 29 '21 19:04 cgrushko