When you jump to the next or previous symbol, this is the code that changes the buffer position, using the editor.scrollToBufferPosition() function. The {center: true} bit should make the buffer center around that position. You can test this by opening a file of sufficient length (let's say 200 lines) and opening the dev tools via View -> Developer -> Toggle Developer Tools, then you can enter atom.workspace.getActiveTextEditor().scrollToBufferPosition([100,0], {center: true}). When I do that, I get line 100 right in the center of my screen. If I enter atom.workspace.getActiveTextEditor().scrollToBufferPosition([100,0], {center: false}), then line 100 is either near the top or near the bottom, same as the behavior of the symbols-view package. The default for the center option is false, so it seems like that object isn't going through somehow, and the default is being used. I'm not sure why it's not working like it should.
From the forums.
When you jump to the next or previous symbol, this is the code that changes the buffer position, using the
editor.scrollToBufferPosition()
function. The{center: true}
bit should make the buffer center around that position. You can test this by opening a file of sufficient length (let's say 200 lines) and opening the dev tools viaView -> Developer -> Toggle Developer Tools
, then you can enteratom.workspace.getActiveTextEditor().scrollToBufferPosition([100,0], {center: true})
. When I do that, I get line 100 right in the center of my screen. If I enteratom.workspace.getActiveTextEditor().scrollToBufferPosition([100,0], {center: false})
, then line 100 is either near the top or near the bottom, same as the behavior of thesymbols-view
package. The default for thecenter
option is false, so it seems like that object isn't going through somehow, and the default is being used. I'm not sure why it's not working like it should.