mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Enforce single-item selection in various actions
We want to show an error when the user tries to invoke an action that expects only a single item to be selected. We're using the GetDisabledReason field to enforce this (as well as DisabledReason on menu items). I've created a ListControllerTrait to store some shared convenience functions for this.
This commit is contained in:
@ -9,8 +9,8 @@ type SideWindowControllerFactory struct {
|
||||
c *ControllerCommon
|
||||
}
|
||||
|
||||
func NewSideWindowControllerFactory(common *ControllerCommon) *SideWindowControllerFactory {
|
||||
return &SideWindowControllerFactory{c: common}
|
||||
func NewSideWindowControllerFactory(c *ControllerCommon) *SideWindowControllerFactory {
|
||||
return &SideWindowControllerFactory{c: c}
|
||||
}
|
||||
|
||||
func (self *SideWindowControllerFactory) Create(context types.Context) types.IController {
|
||||
@ -24,12 +24,12 @@ type SideWindowController struct {
|
||||
}
|
||||
|
||||
func NewSideWindowController(
|
||||
common *ControllerCommon,
|
||||
c *ControllerCommon,
|
||||
context types.Context,
|
||||
) *SideWindowController {
|
||||
return &SideWindowController{
|
||||
baseController: baseController{},
|
||||
c: common,
|
||||
c: c,
|
||||
context: context,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user