mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
add actions abstraction
This commit is contained in:
@ -581,15 +581,7 @@ func (gui *Gui) setControllers() {
|
||||
gui.fileHelper = NewFileHelper(controllerCommon, gui.git, osCommand)
|
||||
gui.workingTreeHelper = NewWorkingTreeHelper(func() *filetree.FileTreeViewModel { return gui.State.FileTreeViewModel })
|
||||
|
||||
tagsController := controllers.NewTagsController(
|
||||
controllerCommon,
|
||||
func() *context.TagsContext { return gui.State.Contexts.Tags },
|
||||
gui.git,
|
||||
getContexts,
|
||||
refHelper,
|
||||
gui.suggestionsHelper,
|
||||
gui.switchToSubCommitsContext,
|
||||
)
|
||||
tagActions := controllers.NewTagActions(controllerCommon, gui.git)
|
||||
|
||||
syncController := controllers.NewSyncController(
|
||||
controllerCommon,
|
||||
@ -629,20 +621,28 @@ func (gui *Gui) setControllers() {
|
||||
gui.fileHelper,
|
||||
gui.workingTreeHelper,
|
||||
),
|
||||
Tags: tagsController,
|
||||
|
||||
Tags: controllers.NewTagsController(
|
||||
controllerCommon,
|
||||
func() *context.TagsContext { return gui.State.Contexts.Tags },
|
||||
gui.git,
|
||||
getContexts,
|
||||
tagActions,
|
||||
refHelper,
|
||||
gui.suggestionsHelper,
|
||||
gui.switchToSubCommitsContext,
|
||||
),
|
||||
LocalCommits: controllers.NewLocalCommitsController(
|
||||
controllerCommon,
|
||||
func() types.IListContext { return gui.State.Contexts.BranchCommits },
|
||||
osCommand,
|
||||
gui.git,
|
||||
tagActions,
|
||||
refHelper,
|
||||
gui.getSelectedLocalCommit,
|
||||
func() []*models.Commit { return gui.State.Commits },
|
||||
func() int { return gui.State.Panels.Commits.SelectedLineIdx },
|
||||
gui.checkMergeOrRebase,
|
||||
syncController.HandlePull,
|
||||
tagsController.CreateTagMenu,
|
||||
gui.getHostingServiceMgr,
|
||||
gui.SwitchToCommitFilesContext,
|
||||
gui.handleOpenSearch,
|
||||
@ -651,7 +651,6 @@ func (gui *Gui) setControllers() {
|
||||
func() bool { return gui.ShowWholeGitGraph },
|
||||
func(value bool) { gui.ShowWholeGitGraph = value },
|
||||
),
|
||||
|
||||
Remotes: controllers.NewRemotesController(
|
||||
controllerCommon,
|
||||
func() types.IListContext { return gui.State.Contexts.Remotes },
|
||||
|
Reference in New Issue
Block a user