Author Topic: Remembering code fold states  (Read 5139 times)

Offline @nthony

  • Multiple posting newcomer
  • *
  • Posts: 17
Remembering code fold states
« on: January 26, 2007, 06:50:00 am »
I don't think I've come across a way to do this yet and I'm not sure if one exists, but is there a way to have CodeBlocks remember/save the state of your code foldings for each file/project?

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Remembering code fold states
« Reply #1 on: January 26, 2007, 07:58:13 am »
Yes and No :)

What happens if you edit the file in a normal text-editor and open it again in C::B?

If you fix that issue, you still have an issue with size of the project file for all the files used within your workspace... each line's fold state have to be remembered...

A patch was uploaded that gives additional options with "Folding All" on open, but this seems not to have made it to the SVN... Will have to ask killerbot about this!

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Remembering code fold states
« Reply #2 on: January 26, 2007, 03:21:01 pm »
Well, I've never used code folding, but I like the idea  :D
What happens if you edit the file in a normal text-editor and open it again in C::B?
No problem, just save the file size or a file checksum with the fold states. If the file was modified outside cb, reset the fold states.
If you fix that issue, you still have an issue with size of the project file for all the files used within your workspace... each line's fold state have to be remembered...
This probably won't be much data.
Maybe:
Code
filename
hash or size
line
line
line
...
where line is the absolute line number, which is folded.

I think this would help developers to get along with the source, if they are continuing work, a little bit :)

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Remembering code fold states
« Reply #3 on: January 29, 2007, 06:34:11 am »
 8) Well then, hack away! It sounds promising!