mirror of
https://github.com/atom/atom.git
synced 2026-02-07 13:14:55 -05:00
Don't prompt to save if buffer is opened elsewhere
This corrects a regression where closing an edit session that is opened somewhere else should not prompt to save since it won't be lost if closed immediately since it is still open in another pane.
This commit is contained in:
@@ -168,7 +168,7 @@ class EditSession
|
||||
scanInBufferRange: (args...) -> @buffer.scanInRange(args...)
|
||||
backwardsScanInBufferRange: (args...) -> @buffer.backwardsScanInRange(args...)
|
||||
isModified: -> @buffer.isModified()
|
||||
hasEditors: -> @buffer.hasEditors()
|
||||
shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors()
|
||||
|
||||
screenPositionForBufferPosition: (bufferPosition, options) -> @displayBuffer.screenPositionForBufferPosition(bufferPosition, options)
|
||||
bufferPositionForScreenPosition: (screenPosition, options) -> @displayBuffer.bufferPositionForScreenPosition(screenPosition, options)
|
||||
|
||||
@@ -148,7 +148,7 @@ class Pane extends View
|
||||
|
||||
@autosaveItem(item)
|
||||
|
||||
if item.isModified?()
|
||||
if item.shouldPromptToSave?()
|
||||
@promptToSaveItem(item, reallyDestroyItem)
|
||||
else
|
||||
reallyDestroyItem()
|
||||
|
||||
@@ -70,7 +70,7 @@ class Buffer
|
||||
path: @getPath()
|
||||
text: @getText() if @isModified()
|
||||
|
||||
hasEditors: -> @refcount > 1
|
||||
hasMultipleEditors: -> @refcount > 1
|
||||
|
||||
subscribeToFile: ->
|
||||
@file.on "contents-changed", =>
|
||||
|
||||
Reference in New Issue
Block a user