From 3960a214e273acdeb37def53a4aa4264a0b9914a Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 4 Jan 2017 10:40:50 -0700 Subject: [PATCH] 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. --- src/text-editor-presenter.coffee | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 5f3d0898d..1637392b5 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -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