6

I've tried to use code regions https://www.jetbrains.com/help/pycharm-edu/code-folding.html#surrounding_with_comments , folded some regions and restarted PyCharm.

When IDE has been restarted, all folded code regions were expanded.

How to save code folding at PyCharm restart?

For example, Visual Studio 2019 saves code folding at IDE restart.

Arthur
  • 3,253
  • 7
  • 43
  • 75

1 Answers1

12

For me the code folding for methods keeps persistent after restart after I activated these checkboxes "Method bodies" and "Custom folding regions". In pycharm: Settings -> Editor -> General -> Code Folding

Marlowe
  • 252
  • 3
  • 15
  • 3
    Tested this now with 2021.2.2. After testing with "Method bodies" and "Custom folding regions". PyCharms began remembering the folded and unfolded functions. I don't like the "Method bodies" behavior because after clicking and "OK" or deselecting and "OK" will mess with all the functions and close and open them all. "Custom folding regions" seems to be sufficient for the purpose to get PyCharm to start remembering the latest state. :shrug: – MadMike Sep 23 '21 at 06:06