How to Remove Unnecessary Line Spacing in Code Editor?

Viewed 328

How can I get rid of the unnecessary line breaks in the Java code editor (see screenshot). This formatting seems to apply just to one project. When I create new projects, there is no extra line spacing.

Thanks!

enter image description here

3 Answers

I believe this is related to Inlay Hints. I had the same issue and it was driving me nuts, then after a restart a bunch of code hints showed up. While useful in the right circumstance, it was a bit baffling when all I could see were these ghost lines. After disabling "Code vision" the issue resolved itself.

Go to settings (Ctrl-Alt-S), under Editor-Inlay Hints there is a checkbox for Code vision. Uncheck that and see if that helps.

This appears to be an issue with the 2022.1 version of IDEA. I had the same symptoms and downgraded to 2021.3. Poof, problem solved. Hopefully they fix this in a newer version soon.

This is indeed related to Editor -> Inlay Hints -> Code vision settings, but for me, it is the Code author option specifically that is adding the seemingly-needless lines.

It seems like IntelliJ creates affordance for the Code author value, but (for me) the value is empty so there is actually nothing showing.

I leave the other Code vision options enabled and just disable the Code author and this appears to be working well so far.

Related