mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
use generics to DRY up context code
This commit is contained in:
parent
4b56d428ff
commit
d93fef4c61
31 changed files with 117 additions and 364 deletions
|
@ -83,11 +83,11 @@ func (self *ListController) HandleNextPage() error {
|
|||
}
|
||||
|
||||
func (self *ListController) HandleGotoTop() error {
|
||||
return self.handleLineChange(-self.context.GetList().GetItemsLength())
|
||||
return self.handleLineChange(-self.context.GetList().Len())
|
||||
}
|
||||
|
||||
func (self *ListController) HandleGotoBottom() error {
|
||||
return self.handleLineChange(self.context.GetList().GetItemsLength())
|
||||
return self.handleLineChange(self.context.GetList().Len())
|
||||
}
|
||||
|
||||
func (self *ListController) HandleClick(opts gocui.ViewMouseBindingOpts) error {
|
||||
|
@ -99,7 +99,7 @@ func (self *ListController) HandleClick(opts gocui.ViewMouseBindingOpts) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if newSelectedLineIdx > self.context.GetList().GetItemsLength()-1 {
|
||||
if newSelectedLineIdx > self.context.GetList().Len()-1 {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue