mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Skip save confirmation for pane
This commit is contained in:
@@ -135,11 +135,11 @@ class Pane extends View
|
||||
@trigger 'pane:item-added', [item, index]
|
||||
item
|
||||
|
||||
destroyActiveItem: =>
|
||||
@destroyItem(@activeItem)
|
||||
destroyActiveItem: (promptToSave=true) =>
|
||||
@destroyItem(@activeItem, promptToSave)
|
||||
false
|
||||
|
||||
destroyItem: (item) ->
|
||||
destroyItem: (item, promptToSave=true) ->
|
||||
container = @getContainer()
|
||||
reallyDestroyItem = =>
|
||||
@removeItem(item)
|
||||
@@ -148,7 +148,7 @@ class Pane extends View
|
||||
|
||||
@autosaveItem(item)
|
||||
|
||||
if item.isModified?()
|
||||
if promptToSave && item.isModified?()
|
||||
@promptToSaveItem(item, reallyDestroyItem)
|
||||
else
|
||||
reallyDestroyItem()
|
||||
|
||||
@@ -37,8 +37,9 @@ class Buffer
|
||||
@lineEndings = []
|
||||
|
||||
if path
|
||||
throw "Path '#{path}' does not exist" unless fs.exists(path)
|
||||
@setPath(path)
|
||||
# throw "Path '#{path}' does not exist" unless fs.exists(path)
|
||||
if fs.exists(path)
|
||||
@setPath(path)
|
||||
if initialText?
|
||||
@setText(initialText)
|
||||
@updateCachedDiskContents()
|
||||
@@ -96,7 +97,8 @@ class Buffer
|
||||
@trigger 'reloaded'
|
||||
|
||||
updateCachedDiskContents: ->
|
||||
@cachedDiskContents = @file.read()
|
||||
if @file?
|
||||
@cachedDiskContents = @file.read()
|
||||
|
||||
getBaseName: ->
|
||||
@file?.getBaseName()
|
||||
|
||||
Reference in New Issue
Block a user