When using IntelliJ IDEA's automatic Java -> Kotlin converter, the blank lines are lost, making the code not that readable. Is there an approach to avoid this or recover the blank lines?
For example,
line1;
line2;
line3;
line4;
may be converted to something without the blank line at the middle.
CodePudding user response:
As a workaround you may do the following:
- Replace all blank lines with some comment. You may do this by replacing
<Ctrl Shift Enter>
\s*
<Ctrl Shift Enter>
with
<Ctrl Shift Enter>
//newLine
<Ctrl Shift Enter>
(don't forget to turn on usage of regex):
- Convert file from Java->Kotlin
- Delete comment (replace it with empty string)

