User forums > Using Code::Blocks
Code folding saving
Manolo:
Hello
When I reopen my project I see that some blocks of code are folded, while others are not. And it seems to me that those blocks were not the same I kept folded last time I used that project.
What I would like to know is when C:B saves the folding status (which blocks to fold) and if there's an option to save it by hand. Perhaps is it done when the file is saved? when the project is saved?
TIA
Manolo
spidamoo:
I have the same issue, so i found this and some similar topics here, but none of them got any answer.
I wonder if there any logical explanation on how C::B decides which blocks to fold when it opens file.
Also it would be nice if C::B did it more obvious like when file saves or there was a way to save folding settings manually. How do I post a feature request?
oBFusCATed:
This is the change that introduced this feature: https://github.com/obfuscated/codeblocks_sf/commit/6452d64e367676aa8b722010e68665ca25346402
In short:
1. there is an option to disable it in the settings
2. the state is saved in the layout file.
3. post exact steps to reproduce the problem of broken folding.
4. what do you mean by save settings manually?
spidamoo:
1. I didn't understand to disable *what*? But I don't think I need to disable *it* anyway, more like I need it to work properly.
2. When does the layout file saves? I believe it happens when I *Save project* or at least when I *Save everything*, whatever "everything" is. Do I understand this right?
3.
1) Say I folded every function block in my source file like this: http://joxi.ru/HbN8UxjKTJAeTpfRCec
2) I click *Save everything* in File menu just to be sure.
3) I exit C::B.
4) I launch C::B and reopen my workspace and see that some random blocks are unfolded while others (it seems to be only few in the beginning of the file) remain folded: http://joxi.ru/V7V8UxjKTJAuTkC8auo
4. I meant since saving source or project or workspace or whatever seems to not affect saving folding settings maybe there is (should be?) some dedicated menu item like *Save folding settings*. Actually it would be much better if folding settings were saved when corresponding source file is saved. Which I believe you intended to implement but there seems to be a bug.
oBFusCATed:
Does this happen with a new simple hello world type of project?
p.s. There is no option, I've been misled by the commit, so this fold saving is always enabled.
Navigation
[0] Message Index
[#] Next page
Go to full version