atom / symbols-view

Jump to symbols in Atom
MIT License
165 stars 115 forks source link

Go To Declaration doesn't correctly pass {center: true} option #205

Closed DamnedScholar closed 7 years ago

DamnedScholar commented 7 years ago

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 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.

50Wliu commented 7 years ago

Looks like a duplicate of #132?

DamnedScholar commented 7 years ago

Yes, it is. Sorry, didn't see that.