1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

no more indirection

This commit is contained in:
Jesse Duffield
2022-01-31 22:20:28 +11:00
parent 2a1e3faa0c
commit 2db4636815
11 changed files with 142 additions and 147 deletions

View File

@ -13,7 +13,7 @@ import (
type BisectController struct {
c *types.ControllerCommon
getContext func() types.IListContext
context types.IListContext
git *commands.GitCommand
bisectHelper *BisectHelper
@ -25,7 +25,7 @@ var _ types.IController = &BisectController{}
func NewBisectController(
c *types.ControllerCommon,
getContext func() types.IListContext,
context types.IListContext,
git *commands.GitCommand,
bisectHelper *BisectHelper,
@ -34,7 +34,7 @@ func NewBisectController(
) *BisectController {
return &BisectController{
c: c,
getContext: getContext,
context: context,
git: git,
bisectHelper: bisectHelper,
@ -232,8 +232,8 @@ func (self *BisectController) selectCurrentBisectCommit() {
// find index of commit with that sha, move cursor to that.
for i, commit := range self.getCommits() {
if commit.Sha == info.GetCurrentSha() {
self.getContext().GetPanelState().SetSelectedLineIdx(i)
_ = self.getContext().HandleFocus()
self.context.GetPanelState().SetSelectedLineIdx(i)
_ = self.context.HandleFocus()
break
}
}
@ -252,5 +252,5 @@ func (self *BisectController) checkSelected(callback func(*models.Commit) error)
}
func (self *BisectController) Context() types.Context {
return self.getContext()
return self.context
}