Open ctbarbour opened 4 years ago
class Test {
fun tryAdd(a: Int?, b: Int?): Int? {
var result: Int? = null
a?.let { lhs ->
b?.let { rhs ->
result = lhs + rhs
}
}
return result
}
}
class Test {
fun tryAdd(a: Int?, b: Int?): Int? {
var result: Int? = null
a?.let { lhs ->
val test = "variable assignment"
val anotherVariable = "another"
b?.let { rhs ->
result = lhs + rhs
}
}
return result
}
}
foo {
context: Context,
environment: Env
->
context.configureEnv(environment)
}
foo { context: Context, // Non-standard style
environment: Env
->
context.configureEnv(environment)
}
I'll give that a try. Thanks!
This still does not work, does it?
assets.open(name).use { source ->
// indents here
}
Please reopen. #53 seems to have stalled.
I was also annoyed by this and have an MR up to fix it: https://github.com/Emacs-Kotlin-Mode-Maintainers/kotlin-mode/pull/73
Now fixed as #53 is merged.
According to the Code Convention documentation:
So the example should probably read:
However, when putting parameters on the first line Kotlin-mode will indent the next line as follows:
Further when adding normal declarations like variable assignment the first line is indented further than the remaining lines in the lambda: