mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Center position where cursor is being set to
This commit is contained in:
@@ -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('')
|
||||
|
||||
Reference in New Issue
Block a user