diff options
author | Arnaud PERALTA <arnaud.peralta@gmail.com> | 2022-11-27 01:10:24 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-12-01 09:12:18 +1100 |
commit | 0af63daf1890bf6be5a299f00033e72826e0af8a (patch) | |
tree | 3b7c37901dbdb3b425c05d6d09b690776244f7ff /pkg/gui/controllers.go | |
parent | 8b894d7bf5813411814d03fe7f0952da5d3985fc (diff) |
workingtree controller fixed with new references for commit in staged menu
Diffstat (limited to 'pkg/gui/controllers.go')
-rw-r--r-- | pkg/gui/controllers.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pkg/gui/controllers.go b/pkg/gui/controllers.go index 4efb5e1ff..98a15b3d8 100644 --- a/pkg/gui/controllers.go +++ b/pkg/gui/controllers.go @@ -24,6 +24,10 @@ func (gui *Gui) resetControllers() { rebaseHelper := helpers.NewMergeAndRebaseHelper(helperCommon, gui.State.Contexts, gui.git, refsHelper) suggestionsHelper := helpers.NewSuggestionsHelper(helperCommon, model, gui.refreshSuggestions) + setCommitMessage := gui.getSetTextareaTextFn(func() *gocui.View { return gui.Views.CommitMessage }) + getSavedCommitMessage := func() string { + return gui.State.savedCommitMessage + } gui.helpers = &helpers.Helpers{ Refs: refsHelper, Host: helpers.NewHostHelper(helperCommon, gui.git), @@ -31,7 +35,7 @@ func (gui *Gui) resetControllers() { Bisect: helpers.NewBisectHelper(helperCommon, gui.git), Suggestions: suggestionsHelper, Files: helpers.NewFilesHelper(helperCommon, gui.git, osCommand), - WorkingTree: helpers.NewWorkingTreeHelper(helperCommon, gui.git, model), + WorkingTree: helpers.NewWorkingTreeHelper(helperCommon, gui.git, gui.State.Contexts, refsHelper, model, setCommitMessage, getSavedCommitMessage), Tags: helpers.NewTagsHelper(helperCommon, gui.git), GPG: helpers.NewGpgHelper(helperCommon, gui.os, gui.git), MergeAndRebase: rebaseHelper, @@ -76,16 +80,10 @@ func (gui *Gui) resetControllers() { bisectController := controllers.NewBisectController(common) - getSavedCommitMessage := func() string { - return gui.State.savedCommitMessage - } - getCommitMessage := func() string { return strings.TrimSpace(gui.Views.CommitMessage.TextArea.GetContent()) } - setCommitMessage := gui.getSetTextareaTextFn(func() *gocui.View { return gui.Views.CommitMessage }) - onCommitAttempt := func(message string) { gui.State.savedCommitMessage = message gui.Views.CommitMessage.ClearTextArea() |