Folding behaviour

Hello

I almost never use code folding, but today I did.
But sometimes when I reopen the function containing the foldings, the folding is gonee and everything is unfolded. Sometimes not.

What is the normal behaviour? Am I missing something? Or isit simply a bug and should code never unfold without pressing the plus sign?

Thanks

I believe OP is talking about code folding in the IDE.

Folded state is not generally remembered
The IDE only keeps a very small cache of open editors IF you happen to return to the code and the editor has not been recycled it should retain folded state
But if the IDE has recycled the editor then the folded state wont be retained

Thanks for the answer Norman!