This commit is contained in:
stereobooster
2016-10-09 23:00:51 +03:00
parent 9b3dfc614a
commit c6a89a4abe
2 changed files with 4 additions and 3 deletions

View File

@@ -878,8 +878,8 @@ class TextEditor extends Model
# Determine whether the user should be prompted to save before closing
# this editor.
shouldPromptToSave: ({windowCloseRequested}={}) ->
if windowCloseRequested
shouldPromptToSave: ({windowCloseRequested, projectHasPaths}={}) ->
if windowCloseRequested && projectHasPaths
false
else
@isModified() and not @buffer.hasMultipleEditors()

View File

@@ -148,7 +148,8 @@ class WindowEventHandler
@document.body.classList.remove("fullscreen")
handleWindowBeforeunload: (event) =>
confirmed = @atomEnvironment.workspace?.confirmClose(windowCloseRequested: true)
projectHasPaths = @atomEnvironment.project.getPaths().length > 0
confirmed = @atomEnvironment.workspace?.confirmClose(windowCloseRequested: true, projectHasPaths: projectHasPaths)
if confirmed and not @reloadRequested and not @atomEnvironment.inSpecMode() and @atomEnvironment.getCurrentWindow().isWebViewFocused()
@atomEnvironment.hide()
@reloadRequested = false