Revert "Skip the first reload event."

This reverts commit 7294b95b70.
This commit is contained in:
joshaber
2016-03-25 14:33:43 -04:00
parent 39dcd59994
commit 952f4aae0e
2 changed files with 2 additions and 15 deletions

View File

@@ -1058,15 +1058,9 @@ export default class GitRepositoryAsync {
}
}
// TextBuffers will emit a reload event when they're first loaded. We don't
// need to refresh in that case.
let firstReload = true
bufferSubscriptions.add(
buffer.onDidSave(refreshStatusForBuffer),
buffer.onDidReload(() => {
if (!firstReload) refreshStatusForBuffer()
firstReload = false
}),
buffer.onDidReload(refreshStatusForBuffer),
buffer.onDidChangePath(refreshStatusForBuffer),
buffer.onDidDestroy(() => {
bufferSubscriptions.dispose()

View File

@@ -448,14 +448,7 @@ class GitRepository
bufferSubscriptions = new CompositeDisposable
bufferSubscriptions.add buffer.onDidSave(getBufferPathStatus)
# TextBuffers will emit a reload event when they're first loaded. We don't
# need to refresh in that case.
firstReload = true
bufferSubscriptions.add buffer.onDidReload(->
getBufferPathStatus() unless firstReload
firstReload = false
)
bufferSubscriptions.add buffer.onDidReload(getBufferPathStatus)
bufferSubscriptions.add buffer.onDidChangePath(getBufferPathStatus)
bufferSubscriptions.add buffer.onDidDestroy =>
bufferSubscriptions.dispose()