I’m having trouble with configuring editor settings for “reformat code”.
Here is example code for reproduction.
I want to remove blank lines between field1
and field2
.
class Foo {
init {
field1 = 2;
}
fun foo1() {
run {
field1
field2
}
}
private var field1: Int = 1
private val field2: String? = null
class InnerClass {}
}
Summary
- Blank lines between two functions are removed.
Lines afterinit { ... }
and beforefun foo1()
are removed. - First consecutive blank lines after
{
are removed.
Lines afterrun {
and beforefield1
are removed. - There are 3 blank lines between
field1
andfield2
, but reformatting does not remove them.
“reformat code” just removes blank indents.
My settings
Here is my setting of Kotlin Code Style.
I am not using editorconfig. (Editor > Code Style > “Enable EditorConfig Support” is disabled)