Pass UserConfig to checkScrollUp/Down instead of just the scrollOffMargin

This will allow us to add a scrollOffEnabled config and have the functions
respect it without changes to clients.
This commit is contained in:
Stefan Haller 2023-08-17 16:27:38 +02:00
parent 527a1596f3
commit 125d4fa9dc
3 changed files with 9 additions and 8 deletions

View file

@ -83,9 +83,9 @@ func (self *ListController) handleLineChange(change int) error {
// we're not constantly re-rendering the main view.
if before != after {
if change == -1 {
checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig.Gui.ScrollOffMargin, before, after)
checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig, before, after)
} else if change == 1 {
checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig.Gui.ScrollOffMargin, before, after)
checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig, before, after)
}
return self.context.HandleFocus(types.OnFocusOpts{})