Symbols-view screen center on symbol definition


#1

Hello there, I’m new to this forums and Atom and I find both of them awesome. Congrats for the work done so far, it’s incredible.

Just one quick question, I think it’s not repeated elsewhere…how can I center the scroll / screen in the symbol definition when using the symbols-view package? When I hit Cmd-R to access the symbol quick goto, Atom shows me the symbol definition at the bottom of the screen, hiding some critic information, like function arguments. Is there any way to make it show at the center of the screen?

Thanks a lot in advance!


#2

I’m not sure how to fix this, because the behavior is wrong. 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.

This is definitely a bug.


#3

Would one of you mind opening an Issue on the symbols-view package and posting a link to the issue here?


#4

Done.


#5

Drat, sorry that I missed that it was already filed. Thanks for going through the effort @DamnedScholar :bow: