Page 1 of 3
Saving files and saving sessions
Posted: 13.10.2020 16:29
by tmsg
If I start Cud with two files on the command line:
and leave Cud immediately the session is saved.
If I start Cud with two files on the command line:
and change one file and then leave Cud the "Save tabs?" dialog pops up. If I decline saving ("Don't save") the session is not saved. The same thing happens if I load a named session on the command line (.cuda-session file).
Further, if I suppress loading a session with -ns but simply load a couple of files and want this set saved in the end in the history session, I can't because Cud seems unwilling to save a session if -ns was given.
EDIT: Or put differently and more simply, no matter what I do (whether I load a named session or use the default session, load files, save files, don't load or don't save files etc etc), I always want the session state saved when I leave Cud.
ALWAYS.
Posted: 13.10.2020 17:14
by Alexey
1. I found code for it, it was made specially but dunno when... not sure we must change it..
Code: Select all
case Form.ShowModal of
//"Don't save/ Keep in session"
mrClose:
Result:= true;
//"Cancel"
mrCancel:
Result:= false;
//"Don't save"
mrNoToAll:
begin
Result:= true; //like for mrClose
UiOps.ReopenSession:= false; //dont save tabs to session <===========!
end;
2.
> I can't because Cud seems unwilling to save a session if -ns was given.
and it looks like logical action.
Posted: 13.10.2020 17:16
by Alexey
>Or put differently and more simply, no matter what I do (whether I load a named session or use the default session, load files, save files, don't load or don't save files etc etc), I always want the session state saved when I leave Cud. ALWAYS.
Need to think..
Posted: 13.10.2020 17:31
by tmsg
Alexey wrote:> I can't because Cud seems unwilling to save a session if -ns was given.
and it looks like logical action.
No, not to me.
Loading a session is one thing and often I don't want to load a session at all but start afresh (or if you prefer, want to start with an empty session) and build up a set of files.
Saving this set into a session is a completely different thing for me and as I already wrote, I
always want to save session state.
Posted: 13.10.2020 20:27
by Alexey
Ok, but if you see the code above, you see that
//"Don't save/ Keep in session"
//"Don't save"
they differ in one thing-- 2nd disables saving session.
if I remove this diff, then 2 buttons will do the same!
Posted: 13.10.2020 20:30
by Alexey
So can you press "don't save/ keep in session"? why do you press "don't save"?
Posted: 13.10.2020 20:31
by Alexey
Posted: 14.10.2020 08:22
by tmsg
Alexey wrote:So can you press "don't save/ keep in session"? why do you press "don't save"?
I can't press this famous button because it's not there! See attached image.
For completeness' sake, in my user.json I have:
"ui_reopen_session_cmdline": true,
"ui_auto_save_session": true,
As "ui_reopen_session": true, is already the default I don't set this in my user.json.
- t.jpg (11.48 KiB) Viewed 1689 times
Posted: 14.10.2020 08:52
by Alexey
I have shown this btn. Beta
http://www.uvviewsoft.com/c/
Lets test how it works
Before it was hidden because of opt ui_history_disabled flag 't'
Posted: 14.10.2020 09:16
by tmsg
This beta seems to solve problem 1 (not 2 though).
However, it introduces another problem not in 115.0. I start Cud fresh with this command line:
Code: Select all
d:\pApps\CudaText\cudatext.exe -s=d:\pApps\CudaText\cudabrief 1.txt
This works as expected and loads 1.txt.
The second start, with the first instance still running:
Code: Select all
d:\pApps\CudaText\cudatext.exe -s=d:\pApps\CudaText\cudabrief 2.txt
produces this window:
- t.jpg (9.72 KiB) Viewed 1685 times