2

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

Daniel Cassidy
  • 24,676
  • 5
  • 41
  • 54

3 Answers3

4

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 + '+'

koto
  • 720
  • 2
  • 9
  • 29
1

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

snovelli
  • 5,804
  • 2
  • 37
  • 50
-1

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

buddy123
  • 5,679
  • 10
  • 47
  • 73