Code Folding lazarus / 9-Editor ---------------------------------------------------------------------- faber · 2010-08-24 08:26 Can I use code folding in "case of" statement ? ---------------------------------------------------------------------- Martin_fr · 2010-08-24 09:05 You may have to use a recent Lazarus Snapshot. Check environments options / editor / code folding. There is an entry for case. (folds the whole case ... end block) Individual case items inside the block are usually begin...end blocks (or one liners). If they are begin end blocks, then they can be folded. ---------------------------------------------------------------------- faber · 2010-08-24 15:00 Thanks for help. I've another problem with saving folding state. When I close lazarus folding state doesn't save.But sometimes it saves. I don't know when and why ?! ---------------------------------------------------------------------- Martin_fr · 2010-08-24 15:10 Which version / revision of lazarus are you on? There where fixes about 1 or 2 month back. also check what is in the project.lps (or lpi, if you don't do lps). (lps may be in your user dir, subfolder lazarus/projectsession ) Is the unit listed only once? does it have some (unreadable) foldstate?. ---------------------------------------------------------------------- faber · 2010-08-24 15:55 Quote from: Martin_fr on August 24, 2010, 05:10:32 pmWhich version / revision of lazarus are you on? There where fixes about 1 or 2 month back. rev. 27140 (win XP), I create new simple project, attached. Quote from: Martin_fr on August 24, 2010, 05:10:32 pmalso check what is in the project.lps (or lpi, if you don't do lps). (lps may be in your user dir, subfolder lazarus/projectsession ) Is the unit listed only once? does it have some (unreadable) foldstate?. I don't have lps, inside lpi I've Code: [Select]My lazarus/projectsession in user dir is always empty. But I found that, when I go to Project Options and change something and then compile,save, close lazarus then folding state saves ok. ---------------------------------------------------------------------- Martin_fr · 2010-08-24 18:09 Quote from: faber on August 24, 2010, 05:55:57 pmBut I found that, when I go to Project Options and change something and then compile,save, close lazarus then folding state saves ok. Ah.  simply folding a block of code, does not mark the session as modified. So it doesn't get saved. - If you switch tabs from one editor to another, that should set the session to modified - I am not sure, if moving the caret does. If anything has marked the session as modified, or if you force saving it (save project, should do that, I believe) then this should always include saving an updated fold-info. ---------------------------------------------------------------------- faber · 2010-08-24 18:32 Yes, switch tabs and everything is ok. Thanks