mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
Merge branch 'master' into global-find
Conflicts: src/app/buffer.coffee
This commit is contained in:
@@ -14,6 +14,7 @@ class Buffer
|
||||
@idCounter = 1
|
||||
undoManager: null
|
||||
modified: null
|
||||
modifiedOnDisk: null
|
||||
lines: null
|
||||
file: null
|
||||
anchors: null
|
||||
@@ -52,11 +53,18 @@ class Buffer
|
||||
this
|
||||
|
||||
subscribeToFile: ->
|
||||
@file?.on "contents-change", =>
|
||||
unless @isModified()
|
||||
@file.on "contents-change", =>
|
||||
if @isModified()
|
||||
@modifiedOnDisk = true
|
||||
else
|
||||
@setText(fs.read(@file.getPath()))
|
||||
@modified = false
|
||||
|
||||
reload: ->
|
||||
@setText(fs.read(@file.getPath()))
|
||||
@modified = false
|
||||
@modifiedOnDisk = false
|
||||
|
||||
getPath: ->
|
||||
@file?.getPath()
|
||||
|
||||
@@ -198,9 +206,13 @@ class Buffer
|
||||
fs.write path, @getText()
|
||||
@file?.updateMd5()
|
||||
@modified = false
|
||||
@modifiedOnDisk = false
|
||||
@setPath(path)
|
||||
@trigger 'after-save'
|
||||
|
||||
isModifiedOnDisk: ->
|
||||
@modifiedOnDisk
|
||||
|
||||
isModified: ->
|
||||
@modified
|
||||
|
||||
|
||||
Reference in New Issue
Block a user