File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package gui
22
33import (
44 "fmt"
5+
6+ "github.com/jesseduffield/gocui"
57)
68
79type ListContext struct {
@@ -160,22 +162,14 @@ func (self *ListContext) handleNextLine() error {
160162}
161163
162164func (self * ListContext ) handleScrollLeft () error {
163- if self .ignoreKeybinding () {
164- return nil
165- }
166-
167- // get the view, move the origin
168- view , err := self .Gui .g .View (self .ViewName )
169- if err != nil {
170- return nil
171- }
172-
173- self .Gui .scrollLeft (view )
174-
175- return self .HandleFocus ()
165+ return self .scroll (self .Gui .scrollLeft )
176166}
177167
178168func (self * ListContext ) handleScrollRight () error {
169+ return self .scroll (self .Gui .scrollRight )
170+ }
171+
172+ func (self * ListContext ) scroll (scrollFunc func (* gocui.View )) error {
179173 if self .ignoreKeybinding () {
180174 return nil
181175 }
@@ -186,7 +180,7 @@ func (self *ListContext) handleScrollRight() error {
186180 return nil
187181 }
188182
189- self . Gui . scrollRight (view )
183+ scrollFunc (view )
190184
191185 return self .HandleFocus ()
192186}
You can’t perform that action at this time.
0 commit comments