def _do_vadjustment_value_changed(self, vadj: Gtk.Adjustment):
"""Handler for when the GtkAdjustment's value is changed.
Emits `nvim-vscrolled` if the widget is not in the middle of an
update and the bounds are still valid, i.e. not changed automatically
by GTK.
:vadj: the adjustment.
"""
if not self.props.updating and vadj.get_upper() == 1.0:
v = vadj.get_value()
v = v if v == 0.0 else v + vadj.get_page_size()
self.emit('nvim-vscrolled', int(v * self.props.lines))
评论列表
文章目录