cheptsov / AdvancedExpressionFolding

https://plugins.jetbrains.com/plugin/9320?pr=idea
140 stars 30 forks source link

Fold short control statements to one line #139

Open stoerr opened 4 years ago

stoerr commented 4 years ago

I'd like to suggest an option to fold short conditional statements into one line:

if (xxx == null) {
    xxx = foo();
}

could be displayed as if (xxx == null) { xxx = foo(); } to reduce the needed vertical space.

Possibly the same thing could be done for other short control statements like while or for - I have no opinion on that. It would do something like the IntelliJ code style option "simple blocks in one line" - but without changing the sourcecode and thus avoiding to collide with others' preferences.