Forum > Editor

Save fold state

(1/2) > >>

I have a problem with saving folding state when closing a project. Sometimes only part of the folds are saved, sometimes not.
From what I noticed if I have a few folds it happens that they are saved when closing the project, but when there are more of them then only the first two/three are saved.
Is there any method to call save fold state manually ?

No, there is no method to call it "independently".

But you can do "Save Project" which will include saving the project session, and saving the fold info.
I doubt that it will  help though.

If some folds are not restored, then that indicates a bug => so even if there would be a save-fold and you called it explicitly, then it would do no better.

In order to be able to fix this, I will need steps to reproduce. I.e. a unit in which that happens, and instructions what I need to fold, so that it wont be restored.

Thanks for info. I can just open for example "C:\lazarus220\components\synedit\synedit.pp" and fold 6 procedures blocks - attached image (before.png).
I made some nonsignificant changes to bring up the save change window when I close lazarus. I save it.
After restart lazarus and opened my project I see only 2 folds - attached image (after.png).

I did a quick test (with 2.2.2 and with my trunk install).

And unfortunately it worked for me (in both versions).

Could you do 2 things please.

1) Compile your IDE (Tools > Configure Build Lazarus) with

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- -dSynFoldDebug  -dSynFoldSaveDebug -dSynCaretDebug  -dSynDebug -dSynTrimDebug  -dSynAssert  -dSynAssertFold And start it with  --debug-log=c:\mylog.txt

And then get me the logs. (Plural, one log for saving the session, a 2nd log for loading it)

Once you saved the project (with the SynEdit) exactly as described in your post find the lps and lpi file and send them to me. Copy the file before you open the project again.

The lps may be in the primary config path / or if your setting is to save the session in the project file, then there is no lps file.

EDIT: I see you are on 2.2.0
But that should make no diff to 2.2.2 for the described behaviour.
I am not aware of any changes between 2.2.0 and 2.2.2 that could have any effect on this.

One more thing....

Did you rebuild your IDE before?  And if so, did you build it with -O2 or higher optimization? If yes, then please rebuild your IDE with -O1 (and select "clean all"), and see if the problem still happens.

There is (at least) one issue in the FPC optimizer that can cause any sort of faulty behaviour. It is extremely rare to actually happen (I know of only one case ever where it did cause problems). So it is unlikely to be the issue. But one never knows....


[0] Message Index

[#] Next page

Go to full version