Author Topic: Code folding is broken, still  (Read 733 times)

Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Code folding is broken, still
« on: December 17, 2018, 05:44:38 pm »

It seems this has been an issue for quite some time: http://forums.codeblocks.org/index.php?topic=18286.0

This is still happening, 5 years later. If you go into the code folding settings under Settings->Editor->Folding and enable "Fold all on file open" (be sure to enable folding itself at the top as well) and then open a source file it always "Toggles All Folds" instead of actually performing a "Fold All".

Case in point: open a source file, go Edit->Folding->Fold All. See it all folded nice and neat, then close it and re-open it. Now it's all unfolded. Close it and open it again and everything will be folded again!

Worse yet: unfold something, leaving everything else folded and close it. Re-open it and now what you unfolded will be folded while everything else that was already folded will be unfolded again. The "Fold All on Open" actually performs a Edit->Folding->Toggle All, which is the equivalent of pressing Shift+F12 instead of performing an Edit->Folding->Fold All, which is what the name of the option under the editor settings would suggest it's supposed to actually do - and would be vastly more useful than flip-flopping the folding state of everything each time you open a file.

Even if I disable "Fold All on Open" it doesn't even retain the folding state of everything properly, at all. It's constantly folding and unfolding random stuff until it 'settles' on a specific folding configuration when it finally stops toggling random things from being folded. Just having folding enables automatically entails having to deal with random stuff being folded and unfolded all the time - and having "Toggle All" as the only folding-related hotkey is totally useless in this situation.

It would be nice if there was a keyboard shortcut for Fold All because it would be WAY more useful than a "Toggle All" hotkey that just toggles everything - which is pretty useless with the bugs that are in play - but I'll settle for the issue above being fixed as it would make CodeBlocks darn well near perfect as an editor IMO.



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11394
    • Travis build status
Re: Code folding is broken, still
« Reply #1 on: December 17, 2018, 05:54:02 pm »
What version are you actually using? After the 17.12 and relatively recently there was a rework of the folding. I'm not sure it has fixed your problem, but it will help with the further discussion...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Re: Code folding is broken, still
« Reply #2 on: December 17, 2018, 06:21:33 pm »


Doesn't look like there's been any new builds for a year.

Offline raynebc

  • Almost regular
  • **
  • Posts: 165
Re: Code folding is broken, still
« Reply #3 on: December 17, 2018, 06:35:18 pm »
Have you tried any of the nightly builds, such as the one from yesterday?

Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Re: Code folding is broken, still
« Reply #4 on: December 17, 2018, 07:04:55 pm »
Not yet, I just downloaded it and am about to try it. Thanks.

Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Re: Code folding is broken, still
« Reply #5 on: December 27, 2018, 10:18:26 am »
Finally got around to trying the 64-bit nightly build from 12-16-18 and it gives me a missing DLL error:


Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Re: Code folding is broken, still
« Reply #6 on: December 27, 2018, 10:20:43 am »
Nevermind, missed the part about the DLLs being a separate download.

Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Re: Code folding is broken, still
« Reply #7 on: January 01, 2019, 03:12:54 pm »
Okay, so after testing, the folding seems to behave as expected with the December 16 2018 nightly build except for the option under Settings->Editor->Folding->"Fold all on file open" which instead of ensuring all foldables are folded on source file open it instead performs the equivalent of Edit->Folding->Toggle All (Shift+F12). So, if you have a source file open and fold a single function, for example, then close the source file and open it back up, now everything will be folded *except* the single folded function, which will be unfolded.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11394
    • Travis build status
Re: Code folding is broken, still
« Reply #8 on: January 01, 2019, 03:51:48 pm »
Ok, now you have to log this as bug report on the sf.net project page, so it is not forgotten.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline deftware

  • Single posting newcomer
  • *
  • Posts: 8
Re: Code folding is broken, still
« Reply #9 on: January 02, 2019, 01:20:13 am »
Will do, thanks.