Using IntelliJ IDEA CE v14.1.16.
I don't know exactly what causes IntelliJ editor to remove blank lines in the Scala source code of a Scala worksheet. Sometimes, the editor doesn't alter the source code. Sometimes it removes blank lines, after a compilation error has been detected. Or after and Worksheet evaluation (clicking on the green triangle icon, Ctrl-Alt-W). Sometimes, blanks lines are removed when clicking on "Clear Results" (the trashbin icon). The problem is that this is not reproducible. Once that happened, I have to reedit the source to put a few blank lines back.
The reason I space the Scala source code by blank lines is to improve readability. I wonder what is the rational for IntelliJ to alter the worksheet source code by removing the blank lines. Is there any setting to disable this behavior?