mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Replace ReplaceContext() with Context().Replace()
This commit is contained in:
parent
98335361fd
commit
111d10fe5c
6 changed files with 4 additions and 9 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue