From 7379627fcbe37d69203b0f3c58005ead57b367d2 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 9 Jun 2014 15:37:02 -0700 Subject: [PATCH] Add several scroll shims to ReactEditorView --- src/react-editor-view.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/react-editor-view.coffee b/src/react-editor-view.coffee index 3a7b8ee37..a7a1e4622 100644 --- a/src/react-editor-view.coffee +++ b/src/react-editor-view.coffee @@ -65,12 +65,22 @@ class ReactEditorView extends View else @editor.getScrollLeft() + scrollToBottom: -> + @editor.setScrollBottom(Infinity) + scrollToScreenPosition: (screenPosition) -> @editor.scrollToScreenPosition(screenPosition) scrollToBufferPosition: (bufferPosition) -> @editor.scrollToBufferPosition(bufferPosition) + scrollToCursorPosition: -> + @editor.scrollToCursorPosition() + + scrollToPixelPosition: (pixelPosition) -> + screenPosition = screenPositionForPixelPosition(pixelPosition) + @editor.scrollToScreenPosition(screenPosition) + pixelPositionForBufferPosition: (bufferPosition) -> @editor.pixelPositionForBufferPosition(bufferPosition)