Mon 08 Jun 2015 06:47:05 PM UTC, comment #2:
I guess this does work in a dev build. I broke something (and fixed differently) with my edits. There is still a small bug here, however. Try what you did once again--naming the files test1.m, test2.m--then relaunch Octave and the files will not be in the editor. My thinking is that those files should be restored as they were never specifically closed. Could rename this report to: "GUI editor does not restore unnamed files saved at close". Or, just mark as not-a-problem as I doubt anyone will report or search for such a subtle bug and this will be addressed shortly. Right now, the filename list is built and saved just prior to save/confirm process, but that should be repeated right after the save/confirm process.
|
Mon 08 Jun 2015 06:24:54 AM UTC, original submission:
I'm in the process of reworking the quit/exit code for another bug report, and I noticed that changes in a new tab, i.e., one for which the tab is labelled "* <unnamed>", are not inquired to save when the GUI editor closes at exit. I've fixed this in the code I'm working on. I can leave the fix for this as part of the changeset I'm about to wrap up, or create a separate one. Any preference?
I will summarize the problem and solution:
The way the editor works at save/confirm is to create a list/table of the files and tab IDs by querying all the tabs, then step through the list processing the tabs for which the contents has been changed. However, the file_editor_tab does not report unnamed files:
Well, the logical approach is to simply to remove that conditional test at the end of the function and always add the file name. That works, except for another required change. Adding the file name is as follows:
Since the file name for all unnamed files is empty, that means if there are multiple "* <unnamed>" files then the fileName is not unique and all but one of the unnamed files is lost.
On the other hand, ID is unique. So the solution is to swap the roles of fileName and ID. That is, make ID the independent variable:
and then of course swap p->first and p->second in the use of the iterator.
|