So I’m creating a TextEditor in a bottom pane like so (abbreviated for brevity):
...
Class MyView
@element = document.createElement 'div'
@textEditorView = document.createElement 'atom-text-editor'
@element.appendChild @textEditorView
@textEditor = @textEditorView.getModel()
....
scrollDown: () ->
@textEditor.setCursorBufferPosition(@range.start)
@textEditor.scrollToCursorPosition()
Class MyModel
@element.appendChild @textEditorView
@MyView = new MyView()
@panel = atom.workspace.addBottomPanel(item: @MyView.getElement(), visible: true)
@MyView.scrollDown()
...
myViewStyle { overflow: scroll; height: 300px;}
But the editor does not scroll when my scroll method is called, only when the user actually scrolls manually, similar to the issue described here.
This leads me to two questions:
1. Is there a way to get this TextEditor in the bottom pane to scroll via the API like I want?
2. If not, I figure I can get it to scroll to where I want with some CSS hacks, but I’d need to be able to get the current line height of the editor in pixels. Is there a way to get this value?