mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Disable buffer modified indicator if buffer content matches content on disk
This commit is contained in:
@@ -248,6 +248,9 @@ class Buffer
|
||||
isModified: ->
|
||||
@modified
|
||||
|
||||
contentDifferentOnDisk: ->
|
||||
fs.read(@file.getPath()) != @getText()
|
||||
|
||||
getAnchors: -> new Array(@anchors...)
|
||||
|
||||
addAnchor: (options) ->
|
||||
|
||||
@@ -33,7 +33,8 @@ class StatusBar extends View
|
||||
@editor.getBuffer().on 'buffer-change', => @updateBufferModifiedText()
|
||||
|
||||
updateBufferModifiedText: ->
|
||||
if @editor.getBuffer().isModified()
|
||||
buffer = @editor.getBuffer()
|
||||
if buffer.isModified() and buffer.contentDifferentOnDisk()
|
||||
@bufferModified.text('*')
|
||||
else
|
||||
@bufferModified.text('')
|
||||
|
||||
Reference in New Issue
Block a user