Search code examples
pycharmcode-foldingcode-regions

How to save code folding after IDE restart?


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.


Solution

  • 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