Skip to content

Commit deee5fa

Browse files
committed
Render the view when scrolling with the wheel
1 parent 44160ef commit deee5fa

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

pkg/gui/context/list_context_trait.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,7 @@ func (self *ListContextTrait) IsItemVisible(item types.HasUrn) bool {
136136
func (self *ListContextTrait) RangeSelectEnabled() bool {
137137
return true
138138
}
139+
140+
func (self *ListContextTrait) RenderOnlyVisibleLines() bool {
141+
return self.renderOnlyVisibleLines
142+
}

pkg/gui/controllers/list_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,19 @@ func (self *ListController) HandleScrollRight() error {
5353
func (self *ListController) HandleScrollUp() error {
5454
scrollHeight := self.c.UserConfig.Gui.ScrollHeight
5555
self.context.GetViewTrait().ScrollUp(scrollHeight)
56+
if self.context.RenderOnlyVisibleLines() {
57+
return self.context.HandleRender()
58+
}
5659

5760
return nil
5861
}
5962

6063
func (self *ListController) HandleScrollDown() error {
6164
scrollHeight := self.c.UserConfig.Gui.ScrollHeight
6265
self.context.GetViewTrait().ScrollDown(scrollHeight)
66+
if self.context.RenderOnlyVisibleLines() {
67+
return self.context.HandleRender()
68+
}
6369

6470
return nil
6571
}

pkg/gui/types/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ type IListContext interface {
153153
FocusLine()
154154
IsListContext() // used for type switch
155155
RangeSelectEnabled() bool
156+
RenderOnlyVisibleLines() bool
156157
}
157158

158159
type IPatchExplorerContext interface {

0 commit comments

Comments
 (0)