Any way to prevent the save modal to pop?


#1

I am trying to prevent the save modal to popup when trying to quit Atom, I want the state to be saved as-is, including non-saved files…I tried with https://github.com/atom/atom-shell/blob/master/docs/api/browser-window.md#event-close but it doesn’t seem to work. Whatever the event I listen to, it’s always after the popup is shown…any ways to hook into the process BEFORE the save modal?

This is the only blocker AFAIK for a Sublime-like quitting experience, which is my main pain point right now with Atom

Thanks!


#2

The code for Save As in Atom is here:

https://github.com/atom/atom/blob/master/src/pane.coffee#L264-271

The Save As dialog is displayed before control is passed down to the TextBuffer class where the will-be-saved event is emitted:

So it would seem to me that your best bet would be to submit a PR with a new event before the Save As dialog is displayed.


#3

Thanks for your reply! I’ll look at that soon-ish :smile: