Saving files and saving sessions

tmsg
Posts: 120
Joined: 20.05.2020 12:08

Saving files and saving sessions

Post by tmsg »

If I start Cud with two files on the command line:

Code: Select all

cudatext 1.txt 2.txt
and leave Cud immediately the session is saved.

If I start Cud with two files on the command line:

Code: Select all

cudatext 1.txt 2.txt
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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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..
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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!
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

So can you press "don't save/ keep in session"? why do you press "don't save"?
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Alexey wrote:So can you press "don't save/ keep in session"? why do you press "don't save"?
:lol: :lol: :lol:
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
t.jpg (11.48 KiB) Viewed 1687 times
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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'
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post 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
t.jpg (9.72 KiB) Viewed 1683 times
Post Reply