mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Prompt split editors to save on close
Previously an editor that was split into multiple panes would not prompt to save correctly when the window was unloading. This adds a new `windowCloseRequested` option passed through from the beforeunload handler to the editor so that it can specially handle this case. Closes #5257
This commit is contained in:
@@ -641,7 +641,11 @@ class TextEditor extends Model
|
||||
|
||||
# Determine whether the user should be prompted to save before closing
|
||||
# this editor.
|
||||
shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors()
|
||||
shouldPromptToSave: ({windowCloseRequested}={})->
|
||||
if windowCloseRequested
|
||||
@isModified()
|
||||
else
|
||||
@isModified() and not @buffer.hasMultipleEditors()
|
||||
|
||||
###
|
||||
Section: Reading Text
|
||||
|
||||
Reference in New Issue
Block a user