1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

use PopContext

This commit is contained in:
Jesse Duffield 2022-02-22 20:17:26 +11:00
parent ecaff7fc6c
commit 120078f011
6 changed files with 9 additions and 9 deletions

View File

@ -18,7 +18,7 @@ func (gui *Gui) handleCommitConfirm() error {
cmdObj := gui.git.Commit.CommitCmdObj(message)
gui.c.LogAction(gui.c.Tr.Actions.Commit)
_ = gui.returnFromContext()
_ = gui.c.PopContext()
return gui.withGpgHandling(cmdObj, gui.c.Tr.CommittingStatus, func() error {
gui.Views.CommitMessage.ClearTextArea()
gui.State.failedCommitMessage = ""
@ -27,7 +27,7 @@ func (gui *Gui) handleCommitConfirm() error {
}
func (gui *Gui) handleCommitClose() error {
return gui.returnFromContext()
return gui.c.PopContext()
}
func (gui *Gui) handleCommitMessageFocused() error {

View File

@ -50,7 +50,7 @@ func (gui *Gui) closeConfirmationPrompt(handlersManageFocus bool) error {
}
if !handlersManageFocus {
if err := gui.returnFromContext(); err != nil {
if err := gui.c.PopContext(); err != nil {
return err
}
}

View File

@ -44,7 +44,7 @@ func (gui *Gui) handleSubmitCredential() error {
message := strings.TrimSpace(credentialsView.TextArea.GetContent())
gui.credentials <- message
credentialsView.ClearTextArea()
if err := gui.returnFromContext(); err != nil {
if err := gui.c.PopContext(); err != nil {
return err
}
@ -54,7 +54,7 @@ func (gui *Gui) handleSubmitCredential() error {
func (gui *Gui) handleCloseCredentialsView() error {
gui.Views.Credentials.ClearTextArea()
gui.credentials <- ""
return gui.returnFromContext()
return gui.c.PopContext()
}
func (gui *Gui) handleAskFocused() error {

View File

@ -17,7 +17,7 @@ func (gui *Gui) handleCreateExtrasMenuPanel() error {
OnPress: func() error {
currentContext := gui.currentStaticContext()
if gui.ShowExtrasWindow && currentContext.GetKey() == context.COMMAND_LOG_CONTEXT_KEY {
if err := gui.returnFromContext(); err != nil {
if err := gui.c.PopContext(); err != nil {
return err
}
}

View File

@ -19,7 +19,7 @@ func (gui *Gui) getMenuOptions() map[string]string {
}
func (gui *Gui) handleMenuClose() error {
return gui.returnFromContext()
return gui.c.PopContext()
}
// note: items option is mutated by this function

View File

@ -26,7 +26,7 @@ func (gui *Gui) handleOpenSearch(viewName string) error {
func (gui *Gui) handleSearch() error {
gui.State.Searching.searchString = gui.Views.Search.TextArea.GetContent()
if err := gui.returnFromContext(); err != nil {
if err := gui.c.PopContext(); err != nil {
return err
}
@ -93,7 +93,7 @@ func (gui *Gui) handleSearchEscape() error {
return err
}
if err := gui.returnFromContext(); err != nil {
if err := gui.c.PopContext(); err != nil {
return err
}