Recent

Author Topic: [SOLVED] Lazarus is not saving my code editor tab layout  (Read 572 times)

QuinnMartin

  • New Member
  • *
  • Posts: 13
[SOLVED] Lazarus is not saving my code editor tab layout
« on: July 22, 2022, 07:24:47 pm »
Specifics: Lazarus V2.0.12 win32 on Win 10.

I have been starting out in Lazarus but I have an ongoing problem with Lazarus not saving the tab layout in the source editor for a project (i.e. the arrangement of units I have open in different tabs).

When I close Lazarus and re-open the project, I see the source editor window with no tabs open, and I have to go and open each unit one by one and try to figure out where I left off.  I have to do this every single time I start Lazarus.

Any idea what is wrong with my setup?
« Last Edit: July 23, 2022, 01:59:05 am by QuinnMartin »

Handoko

  • Hero Member
  • *****
  • Posts: 4723
  • My goal: build my own game engine using Lazarus
Re: Lazarus is not saving my code editor tab layout
« Reply #1 on: July 22, 2022, 08:13:43 pm »
Halo QuinnMartin,
Welcome to the forum.

Maybe there is something wrong with your installation, you may need to reinstall your Lazarus. But I believe your issue happened because you did not enable auto save active desktop:

Lazarus main menu > Tools > Desktops > enable: Auto save active desktop

Desktops is a very useful feature in Lazarus IDE. You can learn more here:
https://forum.lazarus.freepascal.org/index.php/topic,59724.msg445557.html#msg445557

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8462
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus is not saving my code editor tab layout
« Reply #2 on: July 22, 2022, 08:33:24 pm »
If you mean the tabs with the filenames: unit1, unit2, forms, classes, ....

Check under menu: Project > Project Options
then the tab: Project Options > Session

- Enable "save editor info for closed fiels
- Disable "save editor info only for project files"

And ensure you have one of the 3 upper radio buttons selected, so session info is saved.
Recommended: "Save in lps file in project directory" => then you can check the date/time of that file.



Also, maybe check, if files belong to the project. That is if the project inspector lists all your files, well all those that you think belong to the project.
« Last Edit: July 22, 2022, 08:35:18 pm by Martin_fr »

QuinnMartin

  • New Member
  • *
  • Posts: 13
Re: Lazarus is not saving my code editor tab layout
« Reply #3 on: July 22, 2022, 10:58:09 pm »
Quote
enable: Auto save active desktop

I checked and this is enabled.

Quote
- Enable "save editor info for closed files
- Disable "save editor info only for project files"
- Save in lps file in project directory

Yes, I checked and my project is set up exactly as described with all 3 of those recommendations.

So I open a few tabs in Source Editor, Save All, Close All.  Then open the project .lpi file again.  None of the tabs appear, I just get the Project Inspector with the files and units, but the Source Editor does not appear and if I enable it there are no tabs open.

I do notice some weird behavior after using the Close All command.  It still has my project open in Project Inspector with all the files and units listed.  I would expect that list to be cleared.

Really confused by all of this and am wondering if the session functionality is bugged.
« Last Edit: July 22, 2022, 11:00:56 pm by QuinnMartin »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8462
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus is not saving my code editor tab layout
« Reply #4 on: July 22, 2022, 11:12:06 pm »
Quote
Close All

There we go, that is why.

"Close All" => closes all editor files (aka tabs). It is in the "File" menu. It does not close the project. So when you then quit the IDE, it saves the session of your project with all files closed.
https://wiki.lazarus.freepascal.org/Main_menu

There is a "Close project" in the project menu.
It will however ask you to open/create a new project before you can do anything.

The Lazarus IDE does always have a project open. It can't work without.
« Last Edit: July 22, 2022, 11:14:17 pm by Martin_fr »

QuinnMartin

  • New Member
  • *
  • Posts: 13
Re: Lazarus is not saving my code editor tab layout
« Reply #5 on: July 23, 2022, 12:51:23 am »
Ahhh.... ok yes I think I was misunderstanding File Close and Project Close.  I'm fresh from Delphi 7, so having separate sets of Open/Save dialogs in both the File and the Project menu is a little confusing, but I think I can adapt.

However, I am still having a problem:

If I simply File > Quit Lazarus while my project (we'll call it "widgets.lpi") and all its tabs are open, then restart Lazarus, it always starts with an empty "project1" instead of the widgets.lpi project that was active when I closed it.

Is this normal behavior?  Do I need to be opening my project manually each time when starting Lazarus?

wp

  • Hero Member
  • *****
  • Posts: 10288
Re: Lazarus is not saving my code editor tab layout
« Reply #6 on: July 23, 2022, 12:59:36 am »
In menu "Tools" > "Options" > "Environment" > "General" (in Laz 2.0.12 or earlier), or "IDE Startup" (in Laz 2.2.+) you find a checkbox "Open last project and packages at start" which is responsible for this behaviour. It should be checked by default, but maybe you had turned it off at some time.

QuinnMartin

  • New Member
  • *
  • Posts: 13
Re: Lazarus is not saving my code editor tab layout
« Reply #7 on: July 23, 2022, 01:34:13 am »
Thank you!  It looks like it's in Environment > Files in 2.0.12, and you're correct, it was off for some reason.  I don't remember ever unselecting it.

It's fixed!

Also appreciate the responses.  I can't believe I got this much help in 5 hours.  That definitely motivates me to keep working with Lazarus.

 

TinyPortal © 2005-2018