-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Conversation
@@ -77,6 +78,9 @@ class Project extends telepath.Model | |||
destroyUnretainedBuffers: -> | |||
buffer.destroy() for buffer in @getBuffers() when not buffer.isRetained() | |||
|
|||
destroyNonExistentNonModified: -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about destroyUnmodifiedNonExistentBuffers
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it much better.
@@ -117,8 +117,8 @@ class TextBuffer extends telepath.Model | |||
@reload() | |||
|
|||
@file.on "removed", => | |||
@updateCachedDiskContents().done => | |||
@emitModifiedStatusChanged(@isModified()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this emitModifiedStatusChanged
line moved somewhere else? Just wondering if we still needed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it now maintains the modified status of the file emitModifiedStatusChanged
isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆒
I added some 🆕 behavior. If an unmodified buffer is deleted, Atom will remove all editors for that buffer. |
@@ -421,6 +421,17 @@ describe "Pane", -> | |||
view2.trigger 'title-changed' | |||
expect(activeItemTitleChangedHandler).toHaveBeenCalled() | |||
|
|||
describe "when an unmodifed buffer's path is deleted its pane item is removed", -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can kill the its pane item is removed
from this since it is covered in the it
, right? 👇
I notice these specs pop up a lot of dialogs when I run them for some reason. |
Conflicts: src/pane.coffee
This reverts commit e0ad22d.
@state = atom.site.createDocument | ||
deserializer: 'Pane' | ||
items: @items.map (item) -> item.getState?() ? item.serialize() | ||
items: items.map (item) -> item.getState?() ? item.serialize() | ||
items.forEach (item) => @addItem(item, @items.length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried items are going to end up in the state twice here... maybe you should create the state with an empty array and then add them all?
Handle deleted files correctly
Previously, if a file was open in Atom but deleted from the command line (or git, etc...) Atom would keep that buffer open and mark it as modified. This was annoying because when closing Atom it would prompt to be saved. This PR makes Atom treat deleted files as unmodified (unless the file was modified prior to deletion.)
One caveat still exists. The edit session for the deleted file will still be serialized. So a file that doesn't exist on disk will persist when you restart Atom until you explicitly close it. I'd like to wait and fix this problem after we decide on the future of panes.
Created to solve #693