Kotlin comment formatting Automatically wrap with previous line in Android Studio

Viewed 194

When press CTRL+ALT+L formatting, Code will change from CodeA to CodeB.
Can I keep the CodeA without automatically new line?

CodeA:

object Constant {
    /** http request successful */
    const val HTTP_SUC = 1
    /** http request failed  */
    const val HTTP_ERR = -1
    /** No line breaks above  */
    const val TEST = 0
}

CodeB:

object Constant {
    /** http request successful */
    const val HTTP_SUC = 1

    /** http request failed  */
    const val HTTP_ERR = -1

    /** There is a new line on it  */
    const val TEST = 0
}
1 Answers

No, If you want not to have extra line, you should do it manually. When you use shortcut for doing so, you will have extra line.

Related