Scala worksheet blank lines removed (CE 14.1.6)



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?

Comment actions Permalink

Did you check Scala code style setting for the blank lines?

Comment actions Permalink

Hi Serge,

Thank you very much for your help. The setting you showed (Settings / Editor / Code Style / Scala, tab Blanl lines) probably has to do with the issue I got. Let me play around with it.

Do you know what are the conditions which trigger the editor to apply the code style settings on the source? And even better, is there a way to disable it?

Comment actions Permalink


there was a bug in "new" worksheet in Idea 14 as formerly input-output correspondence was shown with alignment rather than vcs-style diff. This caused some empty line being removed in input document. The bug is fixed in idea 15 (in nightly plugin)


Please sign in to leave a comment.