diff --git a/pkg/gui/controllers/commit_description_controller.go b/pkg/gui/controllers/commit_description_controller.go index 80608fff5..50e089fb6 100644 --- a/pkg/gui/controllers/commit_description_controller.go +++ b/pkg/gui/controllers/commit_description_controller.go @@ -53,7 +53,7 @@ func (self *CommitDescriptionController) context() *context.CommitMessageContext } func (self *CommitDescriptionController) switchToCommitMessage() error { - return self.c.ReplaceContext(self.c.Contexts().CommitMessage) + return self.c.Context().Replace(self.c.Contexts().CommitMessage) } func (self *CommitDescriptionController) close() error { diff --git a/pkg/gui/controllers/commit_message_controller.go b/pkg/gui/controllers/commit_message_controller.go index 5c37b4da9..d989086c4 100644 --- a/pkg/gui/controllers/commit_message_controller.go +++ b/pkg/gui/controllers/commit_message_controller.go @@ -85,7 +85,7 @@ func (self *CommitMessageController) handleNextCommit() error { } func (self *CommitMessageController) switchToCommitDescription() error { - if err := self.c.ReplaceContext(self.c.Contexts().CommitDescription); err != nil { + if err := self.c.Context().Replace(self.c.Contexts().CommitDescription); err != nil { return err } return nil diff --git a/pkg/gui/controllers/confirmation_controller.go b/pkg/gui/controllers/confirmation_controller.go index 45bd16a45..542458a71 100644 --- a/pkg/gui/controllers/confirmation_controller.go +++ b/pkg/gui/controllers/confirmation_controller.go @@ -49,7 +49,7 @@ func (self *ConfirmationController) GetKeybindings(opts types.KeybindingsOpts) [ self.c.UserConfig.Keybinding.Universal.Remove, self.c.UserConfig.Keybinding.Universal.Edit) } self.c.Views().Suggestions.Subtitle = subtitle - return self.c.ReplaceContext(self.c.Contexts().Suggestions) + return self.c.Context().Replace(self.c.Contexts().Suggestions) } return nil }, diff --git a/pkg/gui/controllers/suggestions_controller.go b/pkg/gui/controllers/suggestions_controller.go index a425f356e..3908f5267 100644 --- a/pkg/gui/controllers/suggestions_controller.go +++ b/pkg/gui/controllers/suggestions_controller.go @@ -72,7 +72,7 @@ func (self *SuggestionsController) GetKeybindings(opts types.KeybindingsOpts) [] func (self *SuggestionsController) switchToConfirmation() error { self.c.Views().Suggestions.Subtitle = "" self.c.Views().Suggestions.Highlight = false - return self.c.ReplaceContext(self.c.Contexts().Confirmation) + return self.c.Context().Replace(self.c.Contexts().Confirmation) } func (self *SuggestionsController) GetOnFocusLost() func(types.OnFocusLostOpts) error { diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go index da2807eb1..731b0073b 100644 --- a/pkg/gui/gui_common.go +++ b/pkg/gui/gui_common.go @@ -45,10 +45,6 @@ func (self *guiCommon) RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) { return self.gui.runSubprocessWithSuspense(cmdObj) } -func (self *guiCommon) ReplaceContext(context types.Context) error { - return self.gui.State.ContextMgr.Replace(context) -} - func (self *guiCommon) RemoveContexts(contexts []types.Context) error { return self.gui.State.ContextMgr.RemoveContexts(contexts) } diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go index 51005f671..8ece954a7 100644 --- a/pkg/gui/types/common.go +++ b/pkg/gui/types/common.go @@ -57,7 +57,6 @@ type IGuiCommon interface { RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) RunSubprocessAndRefresh(oscommands.ICmdObj) error - ReplaceContext(context Context) error // Removes all given contexts from the stack. If a given context is not in the stack, it is ignored. // This is for when you have a group of contexts that are bundled together e.g. with the commit message panel. // If you want to remove a single context, you should probably use PopContext instead.