How to bind scroll event to the editor ?
editor.on('scroll', function() {
//...
}) ?
or
editor.getSession().on('scroll', function() {
//...
}) ?
editor.session.on("changeScrollTop", function() {})
editor.session.on("changeScrollLeft", function() {})
thx!
@nightwing is there a way to get current, first _and_ last line number?
editor.session.on("changeScrollTop", function() {}) editor.session.on("changeScrollLeft", function() {})
Once event is binded then how to unbind it again. I have tried
editor.session.off();
editor.session.off('scroll');
editor.session.off('changeScrollTop');
var listener = function() {}
session.on("eventName", listener)
session.off("eventName", listener)
var listener = function() {} session.on("eventName", listener) session.off("eventName", listener)
Actually I have tried using an empty function but it doesn't work.
session.off('changeScrollTop', function() {
});
session.off('changeScrollLeft', function() {
});
you need to pass the same function to on and off methods
Most helpful comment