thatfellowoveryonder
thatfellowoveryonder

Reputation: 391

IntelliJ IDEA Code Folding

I started using IntelliJ IDEA to write Java, and one thing kinda annoys me. When I fold a one-line method, it looks like this:

Screenshot 1.

Is there any way to make it look like this?

Screenshot 2

Upvotes: 2

Views: 1498

Answers (3)

snovelli
snovelli

Reputation: 6058

Select the text when the code is "folded" and press CTRL + .

Upvotes: 1

koto
koto

Reputation: 750

Settings -> Editor -> General -> Code Folding. There is an entry 'One-line methods', which is marked by default. You can uncheck this checkbox to get rid of inconvenient code folding. There are shortcuts for folding/unfolding single method by combination Ctrl + '-'/Ctrl + '+', or all methods in a file by combinations Ctrl + Shift + '-'/Ctrl + Shift + '+'

Upvotes: 4

buddy123
buddy123

Reputation: 6327

Its the behavior for short one-liners for more complex methods this will show as screenshot 2

Upvotes: -1

Related Questions