Ask Confirmation Before Saving
Hi,
Is there a way to configure IntelliJ to ask you a save confirmation, with a modal dialog box, before closing a file?
I know tha there is a (*) on the tab that indicates that the file has been changed, but this is not enough. One might press the close button by mistake and the file will be saved while the author might not want this to happen.
Panayotis
请先登录再写评论。
Hi Panayotis,
There is no such an option. However, you can alway check list of files changed locally (in comparison with VCS repo) at 'Changes' tab.
Regards, Denis
Given IDEA's approach to saving files on eg frame deactivation, I'm not sure
what you're asking for even makes much sense? I can't see how it could work
in practice.
If you want to revert you can always use local history, or do what I do:
Set the background colour of readonly files to a slight off-white colour
(Settings -> Editor -> Colors & Fonts -> General -> Background in readonly
files) so you have a clear visual indication if the file has been edited
from the codestore. I also have a quicklist set up that, among other things,
lets me rollback/revert the file really quickly. Also as Denis pointed out,
the changes tab is pretty useful to see what has been modified.
Overall I find IDEA's approach much much nicer than the typical manual save
approach taken by other applications though I suppose it does take a bit
of getting used to.
Thanks for quick answer.
But what about files that are not versioned.
What happened today with me was that I accidentally changed a file which was part of "cancan" gem and I closed it. The file was saved without, of course, my intention.
Not only that. I didn't know which file I changed. The Recent XXXXX menu choices didn't show the file changed.
So, I had my hands up.
I had to do gem prestine cancan to recover the file.
Panayotis
Local history should still work. If you don't know which file(s) were changed,
right-click on a parent directly in the project view and
choose Show Local History from the context menu.