Skip to content

Commit

Permalink
Cleanup: remove now unused ListControllerTrait from SwitchToDiffFiles…
Browse files Browse the repository at this point in the history
…Controller
  • Loading branch information
stefanhaller committed Aug 28, 2024
1 parent ef7d1a8 commit 717cb40
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions pkg/gui/controllers/switch_to_diff_files_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ type CanSwitchToDiffFiles interface {
GetSelectedRefRangeForDiffFiles() *types.RefRange
}

// Not using our ListControllerTrait because our 'selected' item is not a list item
// but an attribute on it i.e. the ref of an item.
// Not using our ListControllerTrait because we have our own way of working with
// range selections that's different from ListControllerTrait's
type SwitchToDiffFilesController struct {
baseController
*ListControllerTrait[types.Ref]
c *ControllerCommon
context CanSwitchToDiffFiles
}
Expand All @@ -30,16 +29,8 @@ func NewSwitchToDiffFilesController(
) *SwitchToDiffFilesController {
return &SwitchToDiffFilesController{
baseController: baseController{},
ListControllerTrait: NewListControllerTrait[types.Ref](
c,
context,
context.GetSelectedRef,
func() ([]types.Ref, int, int) {
panic("Not implemented")
},
),
c: c,
context: context,
c: c,
context: context,
}
}

Expand All @@ -56,6 +47,10 @@ func (self *SwitchToDiffFilesController) GetKeybindings(opts types.KeybindingsOp
return bindings
}

func (self *SwitchToDiffFilesController) Context() types.Context {
return self.context
}

func (self *SwitchToDiffFilesController) GetOnClick() func() error {
return func() error {
if self.canEnter() == nil {
Expand Down

0 comments on commit 717cb40

Please sign in to comment.