Is there a way to observe scrolling?


I made a package that shows a tooltip on the cursor line with some useful information. The thing is the tooltip does not follow scroll because, I guess, it is positioned relatively to the window. So I would like to update its position on scroll. Is that possible?

UPDATE: I found something interesting here. Can I just use Emitter::on("did-change-scroll-top", function() {})?


Finally! I found this thing here. And it works!

So to observe scrolling I just need to do the following:

editor = atom.workspace.getActiveTextEditor()
editor.onDidChangeScrollTop () ->
    // do something...

The topic can be closed now.


Closing per request.