Cabbage Logo
Back to Cabbage Site

Check if a file has been modified before exit

Hi, today I was working on some ideas in the Cabbage editor and then, after some time, I closed Cabbage because I thought I saved the file. But I was wrong: I hadn’t saved it and Cabbage didn’t warn me when I closed it, so I lost the code. Fortunately I remembered all the code I wrote.

The strange thing is that if I save the file before exit, then Cabbage displays a window with “Save changes made to Cabbage patch?”… So, it warns me when I save, but it doesn’t warn me when I don’t save… Shouldn’t it be the contrary? :slight_smile:

It certainly should. If not it’s a bug. I’ll take a look. Btw, Cabbage always saves your file each time you run something?

Yes, I’m used to press ctrl+s to save&run some code, but sometimes I just want to write something to remember later without having to run it. And I didn’t find an option to save without run.

Anyway:

  1. run Cabbage;
  2. write something in the code editor;
  3. Exit from Cabbage with the [X] button of its window => Cabbage exit immediately without asking you to save your changes. At least, this happens on Windows.

I’m just seeing this now myself. Arrggh, I wonder how long its been like this. This is quite a serious issue. Another thing that would be nice would be a “paste to temporary file” option so users could copy code from anywhere and then paste and run it in Cabbage without needing to save the file first.

It would be good. This is the way CsoundQt works: the first time you run a piece of anonymous code, CsoundQt asks you if you want to save the file with a given name or if you want just to run the code as a temp file you don’t care of.