diff options
-rw-r--r-- | pkg/gui/context/list_context_trait.go | 4 | ||||
-rw-r--r-- | pkg/gui/controllers/list_controller.go | 6 | ||||
-rw-r--r-- | pkg/gui/types/context.go | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/context/list_context_trait.go b/pkg/gui/context/list_context_trait.go index aca33cbd0..773f946a9 100644 --- a/pkg/gui/context/list_context_trait.go +++ b/pkg/gui/context/list_context_trait.go @@ -136,3 +136,7 @@ func (self *ListContextTrait) IsItemVisible(item types.HasUrn) bool { func (self *ListContextTrait) RangeSelectEnabled() bool { return true } + +func (self *ListContextTrait) RenderOnlyVisibleLines() bool { + return self.renderOnlyVisibleLines +} diff --git a/pkg/gui/controllers/list_controller.go b/pkg/gui/controllers/list_controller.go index dc876b3fc..711d32f79 100644 --- a/pkg/gui/controllers/list_controller.go +++ b/pkg/gui/controllers/list_controller.go @@ -53,6 +53,9 @@ func (self *ListController) HandleScrollRight() error { func (self *ListController) HandleScrollUp() error { scrollHeight := self.c.UserConfig.Gui.ScrollHeight self.context.GetViewTrait().ScrollUp(scrollHeight) + if self.context.RenderOnlyVisibleLines() { + return self.context.HandleRender() + } return nil } @@ -60,6 +63,9 @@ func (self *ListController) HandleScrollUp() error { func (self *ListController) HandleScrollDown() error { scrollHeight := self.c.UserConfig.Gui.ScrollHeight self.context.GetViewTrait().ScrollDown(scrollHeight) + if self.context.RenderOnlyVisibleLines() { + return self.context.HandleRender() + } return nil } diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go index 29b53b9eb..691d5694d 100644 --- a/pkg/gui/types/context.go +++ b/pkg/gui/types/context.go @@ -153,6 +153,7 @@ type IListContext interface { FocusLine() IsListContext() // used for type switch RangeSelectEnabled() bool + RenderOnlyVisibleLines() bool } type IPatchExplorerContext interface { |