Prompt to Save?

I'm evaluating IDEA9, and just run into an issue I wanted to clarify.  I had opened some random header file to try out IDEA's keyboard short-cuts.  After a few moments I had thoroughly messed up the file and then closed the tab.  Few moments later it dawned on me that IDEA had saved the file! Good thing it was running off of SVN so I did't lose anything.  Reading into documentation it became soon clear that this is how IDEA works ("IntelliJ IDEA saves changes automatically on exit.")  It's possible to disable this functionality, but then a changed file is closed quietly without prompting whether I would like to save the changes I just made.  Why is this?  In an old thread on these forums someone responded to a question "is it possible to get a save prompt everytime you close a modified file?" by saying: "No. Forget it. You don't need to save."

But I do need to save!  Very often I open a file, edit it, then use "Save as" to save it with a different name, and then close the original file, never saving it. Or I open a file, make tentative changes to it, and then decide not to use those changes after all, and just close the file to discard it. The automatic save-on-close makes either of these scenarios impossible, but disabling the auto-save isn't a solution either as equally frequently (or more frequently) I want to save a file I've made changes to. Perhaps this is just "the way IDEA IDE does things", but forcing developers to a particular workflow has never been successful even if there is a good reasoning behind a particular non-standard way of doing things.

So if this feature doesn't currently exist, would it be possible to have it added to IDEA in the next release? I would think it should be fairly easy to add since there are already the options to automatically save or to quietly discard an edited file.

Thanks for any insights on this!

6 comments
Comment actions Permalink

Well, after posting the questions, I noticed older threads Modified notification and file saving and Save which pretty much answered the question. I still think it would be good to offer that option to the users... though perhaps (?) adding such feature would break something else (like the local VCS) in the IDE.

Not having the option to save an individual file (and the prompt to save a changed file when closing it) makes it impossible to make pending/tentative changes to open files. It is often necessary to save a file to the dev server to see whether it produced the desired results (especially in the PHP context), but equally often I don't yet want to save all the changes I've made to the currently open files. I understand this is not possible with IDEA as it currently stands?


0
Comment actions Permalink

Hello Ville,

Well, after posting the questions, I noticed older threads
/message/5251578 and /message/244526 which pretty much answered the
question. I still think it would be good to offer that option to the
users... though perhaps (?) adding such feature would break something
else (like the local VCS) in the IDE.

Not having the option to save an individual file (and the prompt to
save a changed file when closing it) makes it impossible to make
pending/tentative changes to open files. It is often necessary to save
a file to the dev server to see whether it produced the desired
results (especially in the PHP context), but equally often I don't
yet want to save all the changes I've made to the currently open
files. I understand this is not possible with IDEA as it currently
stands?


No, this is not possible. There's a lot of features in IDEA that rely on
being able to save anything to disk at any time. For pending/tentative changes,
you can use either Undo, Local History or the "Revert" action in the VCS
integration (you do have your code stored under version control, don't you?).

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,

Thanks for the response. It indeed makes more sense in a version controlled environment where revert to the previous version in the VCS only a "click away".  In this particular case I was working on CMS-controlled code which, while CMS versions it, is not really versioned (in the sense of SVN, for instance) which makes reverting to previous version more painful.

I'll try IDEA in an SVN-versioned project next and reserve some other tool like UEStudio for the CMS work.

Ville

0
Comment actions Permalink

That's the great thing about IDEA; with local history you have revert to
previous version only a 'click away' even in non-VCS projects. Give it a
try, you really can revert to any state from days before.

0
Comment actions Permalink

This reminded my shock when I first tried IDEA, and now, to be honest, I hate the prompt saving dialogs.          

0
Comment actions Permalink

Local History is also extremely powerful and not to be overlooked. Even if you don't want to revert all the way back to the source control version, it's almost always possible to get to an earlier edit of the code using the local history. I've been using IDEA for a long time and even though I still routinely Ctrl-S out of long-ingrained habit, I think IDEA is the gold standard for the way apps should handle file saving.

0

Please sign in to leave a comment.