mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Buffer.save only writes to disk if the buffer is modified
This prevents autosave from writing unmodified buffers to disk, which was causing the tree view to rebuild directory contents based on the write event just when switching tabs.
This commit is contained in:
@@ -238,7 +238,7 @@ class Buffer
|
||||
@undoManager.redo(editSession)
|
||||
|
||||
save: ->
|
||||
@saveAs(@getPath())
|
||||
@saveAs(@getPath()) if @isModified()
|
||||
|
||||
saveAs: (path) ->
|
||||
unless path then throw new Error("Can't save buffer with no file path")
|
||||
|
||||
Reference in New Issue
Block a user