Use atom.confirm when closing an unsaved buffer

This commit is contained in:
Nathan Sobo
2012-08-29 20:24:48 -05:00
parent 8cf22da082
commit e47c59c35f

View File

@@ -562,15 +562,13 @@ class Editor extends View
return if @mini
if @getBuffer().isModified()
filename = if @getPath() then fs.base(@getPath()) else "untitled buffer"
message = "'#{filename}' has changes, do you want to save them?"
detailedMessage = "Your changes will be lost if you don't save them"
buttons = [
["Save", => @save() and @destroyActiveEditSession()]
["Cancel", =>]
["Don't save", => @destroyActiveEditSession()]
]
Native.alert message, detailedMessage, buttons
atom.confirm(
"'#{filename}' has changes, do you want to save them?"
"Your changes will be lost if you don't save them"
"Save", (=> @save() and @destroyActiveEditSession())
"Cancel", null
"Don't save", (=> @destroyActiveEditSession())
)
else
@destroyActiveEditSession()