Merge remote-tracking branch 'origin/master'

Conflicts:
	src/app/status-bar.coffee
This commit is contained in:
Corey Johnson 2012-11-02 15:53:53 -07:00
commit 25744fcd61
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ describe "StatusBar", ->
# updating the status bar is asynchronous for performance reasons
# for testing purposes, make it synchronous
spyOn(_, 'defer').andCallFake (fn) -> fn()
spyOn(_, 'delay').andCallFake (fn) -> fn()
afterEach ->
rootView.remove()

View File

@ -36,15 +36,15 @@ class StatusBar extends View
@updatePathText()
@updateCursorPositionText()
@editor.on 'cursor-move', => _.defer => @updateCursorPositionText()
@editor.on 'cursor-move', => _.delay (=> @updateCursorPositionText()), 50
@subscribeToBuffer()
subscribeToBuffer: ->
@buffer?.off '.status-bar'
@buffer = @editor.getBuffer()
@buffer.on 'change.status-bar', => _.defer => @updateBufferModifiedText()
@buffer.on 'after-save.status-bar', => _.defer => @updateStatusBar()
@buffer.on 'change.status-bar', => _.delay (=> @updateBufferModifiedText()), 50
@buffer.on 'after-save.status-bar', => _.delay (=> @updateStatusBar()), 50
@updateStatusBar()
updateStatusBar: ->