Center position where cursor is being set to

This commit is contained in:
Kevin Sawicki
2012-12-11 15:38:11 -08:00
parent 0e40580a28
commit 43658ddc52

View File

@@ -50,7 +50,11 @@ class OutlineView extends SelectList
confirmed : ({position, name}) ->
@cancel()
@rootView.getActiveEditor().setCursorBufferPosition(position)
editor = @rootView.getActiveEditor()
screenPosition = editor.screenPositionForBufferPosition(position)
pixelPosition = editor.pixelPositionForScreenPosition(screenPosition)
editor.scrollTo(pixelPosition, center: true)
editor.setCursorBufferPosition(position)
cancelled: ->
@miniEditor.setText('')