mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
use generics to DRY up context code
This commit is contained in:
@ -80,7 +80,7 @@ func (self *CommitFilesController) GetMouseKeybindings(opts types.KeybindingsOpt
|
||||
|
||||
func (self *CommitFilesController) checkSelected(callback func(*filetree.CommitFileNode) error) func() error {
|
||||
return func() error {
|
||||
selected := self.context().GetSelectedFileNode()
|
||||
selected := self.context().GetSelected()
|
||||
if selected == nil {
|
||||
return nil
|
||||
}
|
||||
@ -98,7 +98,7 @@ func (self *CommitFilesController) context() *context.CommitFilesContext {
|
||||
}
|
||||
|
||||
func (self *CommitFilesController) onClickMain(opts gocui.ViewMouseBindingOpts) error {
|
||||
node := self.context().GetSelectedFileNode()
|
||||
node := self.context().GetSelected()
|
||||
if node == nil {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user