Java to Kotlin converter: keep more than one blank line from original code
This commit is contained in:
@@ -108,7 +108,8 @@ class CodeBuilder(private val topElement: PsiElement?) {
|
||||
for (i in prefixElements.indices) {
|
||||
val e = prefixElements[i]
|
||||
if (i == 0 && e is PsiWhiteSpace) {
|
||||
if (e.newLinesCount() > 1) { // insert at maximum one blank line
|
||||
val blankLines = e.newLinesCount() - 1
|
||||
for (_ in 1..blankLines) {
|
||||
append("\n", false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ class F {
|
||||
fun f1() {
|
||||
}
|
||||
|
||||
|
||||
fun f2() {
|
||||
}
|
||||
var i: Int? = 0
|
||||
|
||||
@@ -7,6 +7,7 @@ class F {
|
||||
fun f1() {
|
||||
}
|
||||
|
||||
|
||||
//c3
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class F {
|
||||
|
||||
|
||||
//c3
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ class F {
|
||||
fun f1() {
|
||||
}
|
||||
|
||||
|
||||
//c3
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ public class Language(protected var code: String) : Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Base {
|
||||
fun test() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user