Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: kccasey on August 09, 2012, 10:50:33 pm

Title: How do I exit code blocks without saving?
Post by: kccasey on August 09, 2012, 10:50:33 pm
I would like to Exit without saving.
It seems that code blocks saves my changes to my code as soon as I compile.  Sometimes I will screw up a program so badly that it is best to just revert back to my original.
Does anyone have a solution?

KC

Title: Re: How do I exit code blocks without saving?
Post by: dmoore on August 09, 2012, 11:22:42 pm
The damage has been done before you exit. Code::Blocks needs to save before compiling because the compiler works with the files outside of Code::Blocks.

The best solution is version control or frequent back ups. (I will often make backup copies of files before I tinker with them if I don't have them in version control already, but version control is the best for tinkering with working code)
Title: Re: How do I exit code blocks without saving?
Post by: Jenna on August 09, 2012, 11:38:37 pm
If the editor is still open, you can use "Edit -> Undo" or CTRL + Z to undo changes, but it's of course better to have a working version control system if possible.

git works good with local repos and it's not too hard to setup and use (at least on linux).
Title: Re: How do I exit code blocks without saving?
Post by: kccasey on August 09, 2012, 11:48:42 pm
Thank you

I work with a text editor a lot so I'm spoiled.

It would be nice if  code blocks created a temp file from my original to compile, leaving my original intact .
This way I could save only when I'm confident. Just a wish.

Backups until then.

Thanks again
Title: Re: How do I exit code blocks without saving?
Post by: MortenMacFly on August 10, 2012, 08:21:43 am
Backups until then.
there is an AutoSave plugin that accounts for exactly this - you can setup when and how often your files are backed up and thus restore them at any time.
Title: Re: How do I exit code blocks without saving?
Post by: cacb on August 10, 2012, 10:04:36 am
I would like to Exit without saving.
It seems that code blocks saves my changes to my code as soon as I compile.  Sometimes I will screw up a program so badly that it is best to just revert back to my original.
Does anyone have a solution?

KC

This is what source control is for. Personally, I prefer Bazaar (http://bazaar.canonical.com/en/), but there are other good alternatives as well. When I screw up or change my mind, I simply use the revert function in Bazaar. I think Code::Blocks does what it should do, save files often. Perhaps it should even save project files more often IMHO.