mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Set groundwork for better disabled reasons with range select
Something dumb that we're currently doing is expecting list items to define an ID method which returns a string. We use that when copying items to clipboard with ctrl+o and when getting a ref name for diffing. This commit gets us a little deeper into that hole by explicitly requiring list items to implement that method so that we can easily use the new helper functions in list_controller_trait.go. In future we need to just remove the whole ID thing entirely but I'm too lazy to do that right now.
This commit is contained in:
@ -16,6 +16,7 @@ type ContainsCommits interface {
|
||||
types.Context
|
||||
types.IListContext
|
||||
GetSelected() *models.Commit
|
||||
GetSelectedItems() ([]*models.Commit, int, int)
|
||||
GetCommits() []*models.Commit
|
||||
GetSelectedLineIdx() int
|
||||
}
|
||||
@ -36,6 +37,7 @@ func NewBasicCommitsController(c *ControllerCommon, context ContainsCommits) *Ba
|
||||
c,
|
||||
context,
|
||||
context.GetSelected,
|
||||
context.GetSelectedItems,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user