Topic: How edit tabs are being saved

I don't know whether the way in which editing tabs are saved has changed recently or has been like this since this feature was first introduced, but I am not finding this as convenient as it might be.

With this new feature, I have been expecting to find, when I re-open a current project, that all the editing tabs I had open when last I closed Simply Fortran, would still be there.  What I've noticed, instead, is that the editor keeps losing the tabs I had open and is reverting to the tabs I had open some time previously, making it necessary (a bit laboriously) to close all these one by one, then to open again the ones I was last working on.

I've investigated why this happens and what I've found is that the editor reverts to the tabs that were open when last I did a manual project-save.   This is better than nothing but it isn't terribly helpful.

I don't know if a Windows limitation means that everything is lost, at the instant when a user clicks the 'x' Window-CLOSE icon, meaning  that tabs simply CAN'T be saved unless the user actually SAVES them, but if this is the problem then could Simply Fortran possibly save all tabs every time anything was saved, not just the project? 

If this is not a great idea for everyone, then perhaps it could be made an editor option whether tabs are saved when saving the project, when saving any file, or not at all.
---
John

Re: How edit tabs are being saved

John,

Yes, indeed the tabs are only ever saved when the project is saved manually.  I don't want to have Simply Fortran arbitrarily saving the project without the user's permission, and these tabs are saved in the project file.

I continue to be conflicted on this topic, however.  I do understand what you're requesting, and I agree with you.  In that case, though, tab information should be stored in a non-project location, possibly Simply Fortran's settings. 

One option would be to have some sort of automatic project saving mechanism where the project file would be written every time the user saves any project file.  Tab changes could also trigger the internal "project modified" flag to warn the user at exit to save; perhaps saving the project at exit could be automatic as well. 

I'm not sure what the correct answer is, but I am open to more suggestions.  I am leaning towards storing what tabs are open in a separate non-project-file location.

Jeff Armstrong
Approximatrix, LLC

Re: How edit tabs are being saved

I see the problem.  I agree you should not have the .prj file saved until the user  wants it saved, because we would not want to find that some experimental tinkering we might have done with the project, which proved unsuccessful, had overwritten the project as it was beforehand.

An idea:  Is it possible for the .prj file to be saved via a buffer area in memory?  That way, the .prj file could have two sections, say, the 'USER' area, with the user's settings, project structure and so forth, and the 'SYSTEM' area, with things like a list of currently-open tabs, a record of which was the open one, where the cursor was, and maybe anything else that's useful to put in it.

Then, every time the user does any file SAVE, SAVE-AS, or OPEN,
(i)  all the USER data will remain unchanged in the buffer,
(ii) only the SYSTEM data will write to the  buffer,
(iii) the buffer will write to the .prj file.

and, every time the user does a SAVE-PROJECT,
(i)  all the USER data will write to the buffer,
(ii) all the SYSTEM data will write to the  buffer,
(iii) the buffer will write to the .prj file.

You might think the danger with this is that the .prj file gets hammered, increasing the number of opportunities for it to break.

4 (edited by davidb 2014-04-09 17:53:59)

Re: How edit tabs are being saved

I quite like things as they are. Only save tab list when the project is saved. I wouldn't want it to update in the background.

However, there could be a reminder when a user changes something in the project settings and then tries to close the project without saving first. Something like (Save changes) or (Discard changes) dialog. This should pop up when the user re-organises the tabs too as these are part of the project settings. This would at least give John the option he wants.

You need to keep the tab list in the project; otherwise there will be confusion when the project is changed.


Edit: Having said the above, I am not finding my open tabs are being saved when I save the project, so could be a bug here.

--
David

Re: How edit tabs are being saved

David,

Thanks for more input.  Concerning your tabs not being saved, have you enabled that option?  That feature is off by default.  Make sure it's checked in the Options menu.

Jeff Armstrong
Approximatrix, LLC

6 (edited by davidb 2014-04-10 08:05:17)

Re: How edit tabs are being saved

Thanks.

I didn't know that it was optional.

I have enabled it now (to see if I like it) and it works.

However, some feedback ...

- I ticked this option and saved my project.
- I then unticked (disabled) the option and quit SF2 (closing my project without saving).
- I then re-opened my project and the tabs still appear, despite the option being unticked (disabled).

So you should either.
(a) Honour this option setting when opening a project - show tabs if enabled, don't show if disabled, or
(b) Move this option to be part of the project properties (so it applies on a project by project basis).

I think (a) would be easier to do of the two.

Note that if the option is disabled when a project is saved, you should clear the list of tabs from the project settings file. I think you are doing this, but should continue to do so once you implement (a).

--
David

7 (edited by JohnWasilewski 2014-04-10 07:52:34)

Re: How edit tabs are being saved

I'd still rather have it so that, when I click the close button to exit from a project, all my tabs are preserved and when I next open that project, hey presto, everything is as I left it, ready for me to resume.

This functionality is already available but only if I remember to 'save-project' before closing it.
It is intuitively necessary to save-project after altering the project somehow, such as by adding or removing some source files, but the editing tabs are just a window into the project, they are not part of the project.

If the consensus is that save-project ought to continue to be needed to preserve the last-opened tabs, well, I cannot but concede that that will hardly be a great hardship!
---
J.

8 (edited by davidb 2014-04-10 08:31:38)

Re: How edit tabs are being saved

Hi John,

But what should happen when a user opens a second project. Do you still want the files from the last project opened as well? I don't think you would. This is why the tab list is stored as part of the project.

Personally, I think that a reminder to save the project changes when SF2 is closed would be a good idea.

It would also be possible to have a second option, "Always save project tabs on exit", which would give you exactly what you want without having to save the project. To be "nice" to the other option, this should be greyed out if the other option is disabled.

So SF2 would have all bases covered to suite three user preferencies ...

John's preferred settings:

   Remember Project tabs = Enabled
   Always save Project tabs on exit  = Enabled

What I would use:

   Remember Project tabs = Enabled
   Always save Project tabs on exit  = Disabled

Other possibility:

   Remember Project tabs = Disabled
   Always save Project tabs on exit  = Doesn't matter (inactive).

--
David

Re: How edit tabs are being saved

davidb wrote:

But what should happen when a user opens a second project. Do you still want the files from the last project opened as well? I don't think you would. This is why the tab list is stored as part of the project.

Naturally I agree with you David, and they would not be - or at least, that's not what I intended.  If I'm in a project, I want SF to give me all the tabs I last had open when I was in that same project before.

My suggestion is thus wholly project-specific.  I simply mean that, every time we SAVE anything (in a project), the project file remembers the tabs. 

I asked Jeff to consider this because, in my usual usage of SF, I was finding that it wasn't doing what I needed.
I SAVE regularly.  When I alter a project, I save the project.  When I edit a source file, I save the file.  I don't, intuitively, see opening a tab as altering anything in the project so that doesn't trigger a "must-save" reflex. 

When I've finished a session I close SF.  When I resume work on the same project, I hope to see the same tabs open as where I left off, and they're not there!  Solution: ask Jeff to try to save the PROJECT tabs every time I save anything (file or project). 

I can see that this is a little more tricky to implement than first meets the eye, because we don't want project settings to save unless we expressly save the project.  Snag is, if the tabs are project-specific (as we all seem to agree they need to be) then the project does need to be saved - which we don't always want!  Maybe Jeff can solve this.  I suggested a way, though I  think my suggestion is not very good.  It also doesn't seem like a priority matter.  I don't know how much more time Jeff will be willing to allocate to this (very excellent) product, but I'd much rather see other features developed than this one!  Example-1: one-click switching between projects (a great help when we are developing more than one at a time and they are inter-dependent.  Example-2: clickable selection of debug and release versions of the same project.  Example-3: clickable switching an entire project between different versions (eg 32 and 64 bit).  Example-4: more functionality in the debugger (eg better handling of multi-d array variable watching, conditional breakpoints, editable variable values).

I'm therefore happy to throw in the towel in the debate about how tabs are saved!
Nice discussion though.
---
John

Re: How edit tabs are being saved

Lets see what Jeff thinks. He may yet implement what you would like and keep everyone happy (my posts 6(a) and 7 should do that).

--
David

11 (edited by davidb 2017-07-12 08:16:54)

Re: How edit tabs are being saved

Jeff,

I am trying to understand what has changed in 2.38 regarding tabs.

When the option "Save Open tabs with project" is enabled, are tab positions supposed to be saved automatically now or do we still need to manually save the project?

If I make a change then quit the program the program could check if the tab positions have changed relative to the ones in the file and warn the user, with the option to re-save positions. Is it supposed to do this?


I like the fact that the Build and Console tabs now have their own panel. Very nice.

Thanks for implementing this and the other features and bug fix (indefinite indexing) in v2.38.

David.

--
David

Re: How edit tabs are being saved

David,

Tabs only save when you save the project manually.  Simply Fortran won't write to it without asking. 

I suppose a warning could be issued that the project is modified if you move tabs around, but I'd be interested to hear from other users.  I would lean towards a warning box that could be disabled forever, though.

Jeff Armstrong
Approximatrix, LLC