Call debounced cursor blink resume callback any time the cursor moves

Previously, we were only calling the debounced resume callback when the
cursor was already blinking, but this meant we didn't renew the debounce
window. This in turn meant we attempted to start blinking the cursor
again every 100ms regardless of cursor interactions, which was consuming
an extra frame and causing cursor movement to not feel smooth.
This commit is contained in:
Nathan Sobo 2017-01-04 10:40:50 -07:00
parent 9db8fa382b
commit 3960a214e2

View File

@ -1412,11 +1412,10 @@ class TextEditorPresenter
@emitDidUpdateState()
pauseCursorBlinking: ->
if @isCursorBlinking()
@stopBlinkingCursors(true)
@startBlinkingCursorsAfterDelay ?= _.debounce(@startBlinkingCursors, @getCursorBlinkResumeDelay())
@startBlinkingCursorsAfterDelay()
@emitDidUpdateState()
@stopBlinkingCursors(true)
@startBlinkingCursorsAfterDelay ?= _.debounce(@startBlinkingCursors, @getCursorBlinkResumeDelay())
@startBlinkingCursorsAfterDelay()
@emitDidUpdateState()
requestAutoscroll: (position) ->
@pendingScrollLogicalPosition = position