Any way to save code folding? lazarus / 9-Editor ---------------------------------------------------------------------- dkjMusic · 2011-01-06 23:38 I'm using Lazarus 0.9.31 on Ubuntu 10.10. I would like the IDE to save the code folding for my project. I tried the following, from a post here on the subject (http://www.lazarus.freepascal.org/index.php/topic ,10290.msg50818.html#msg50818), but cannot get it to work: "go to Project Options and change something and then compile,save, close lazarus then folding state saves ok." In Project Options/Session I have the following checked: Save editor info for closed files, Save editor info only for project files, and save in .lps file in project directory. When I fold all procedures and functions in Main.pas and do the above, the project opens back up with only six out of a couple dozen folded. Has anyone gotten the IDE to save code folding in Linux Lazarus? ---------------------------------------------------------------------- Martin_fr · 2011-01-07 00:31 Then you may have a discovered a bug. The code-folding should be saved with all other session info. This happens if the project session is modified. (Which is, why in the other post, I said "change to other editor/tab") You can test. If you move the caret, and restart the IDE, then if the session was saved, the caret should be at the position you moved it to. If that happens (the caret pos is saved), then code-folding should be saved too. Exceptions: - the state for {%region "some text" /fold} is not saved. They are always folded. Other region should remember. - if you edit the file outside the IDE, then the fold-state may not be restored, because lines are not found, where they are expected. Any other fold not restored (especially if some are restored) is probably a bug. If reported, the file in which to reproduce, and instructions which lines to fold will be needed. Can be send in private, if confidential. ---------------------------------------------------------------------- dkjMusic · 2011-01-07 03:12 Quote from: Martin_fr on January 07, 2011, 01:31:53 amThe code-folding should be saved with all other session info. This happens if the project session is modified. (Which is, why in the other post, I said "change to other editor/tab") You can test. If you move the caret, and restart the IDE, then if the session was saved, the caret should be at the position you moved it to. If that happens (the caret pos is saved), then code-folding should be saved too. Yes, I'm using the "change to other editor/tab"/Save Project method you gave. Moving the caret, saving, and reopening gives the caret in the new position. But the code-folding is not saved. I originally developed the project with Lazarus 0.9.28.2 then started using 0.9.31. Could there be a configuration file left around which is causing the problem? I ask this because now when I build a brand new project, after reconciling the "Error building resources" thing due to a space in the project path, the code folding IS saved. ---------------------------------------------------------------------- Martin_fr · 2011-01-07 12:07 I am not aware of any option to disable this saving, other than the "Save editor info" in the project session. Config files are in the users home dir (depends on OS) for Vista: C:\Users\USER\AppData\Local\lazarus or wherever your --primary-config-path=  has set them to. lps files may be there (in projectsessions) or wherever you set them to be. lps files (or lpi, if you choose) have an entry per unit, and if fold state is saved it contains something like: If you change the folds, then the code should change too. If it is there and if it changes then foldstate is saved. Foldstate is either saved entirely or not at all (except for the %region)