mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-11 11:42:12 +02:00
use PopContext
This commit is contained in:
parent
ecaff7fc6c
commit
120078f011
@ -18,7 +18,7 @@ func (gui *Gui) handleCommitConfirm() error {
|
|||||||
cmdObj := gui.git.Commit.CommitCmdObj(message)
|
cmdObj := gui.git.Commit.CommitCmdObj(message)
|
||||||
gui.c.LogAction(gui.c.Tr.Actions.Commit)
|
gui.c.LogAction(gui.c.Tr.Actions.Commit)
|
||||||
|
|
||||||
_ = gui.returnFromContext()
|
_ = gui.c.PopContext()
|
||||||
return gui.withGpgHandling(cmdObj, gui.c.Tr.CommittingStatus, func() error {
|
return gui.withGpgHandling(cmdObj, gui.c.Tr.CommittingStatus, func() error {
|
||||||
gui.Views.CommitMessage.ClearTextArea()
|
gui.Views.CommitMessage.ClearTextArea()
|
||||||
gui.State.failedCommitMessage = ""
|
gui.State.failedCommitMessage = ""
|
||||||
@ -27,7 +27,7 @@ func (gui *Gui) handleCommitConfirm() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleCommitClose() error {
|
func (gui *Gui) handleCommitClose() error {
|
||||||
return gui.returnFromContext()
|
return gui.c.PopContext()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleCommitMessageFocused() error {
|
func (gui *Gui) handleCommitMessageFocused() error {
|
||||||
|
@ -50,7 +50,7 @@ func (gui *Gui) closeConfirmationPrompt(handlersManageFocus bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !handlersManageFocus {
|
if !handlersManageFocus {
|
||||||
if err := gui.returnFromContext(); err != nil {
|
if err := gui.c.PopContext(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ func (gui *Gui) handleSubmitCredential() error {
|
|||||||
message := strings.TrimSpace(credentialsView.TextArea.GetContent())
|
message := strings.TrimSpace(credentialsView.TextArea.GetContent())
|
||||||
gui.credentials <- message
|
gui.credentials <- message
|
||||||
credentialsView.ClearTextArea()
|
credentialsView.ClearTextArea()
|
||||||
if err := gui.returnFromContext(); err != nil {
|
if err := gui.c.PopContext(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ func (gui *Gui) handleSubmitCredential() error {
|
|||||||
func (gui *Gui) handleCloseCredentialsView() error {
|
func (gui *Gui) handleCloseCredentialsView() error {
|
||||||
gui.Views.Credentials.ClearTextArea()
|
gui.Views.Credentials.ClearTextArea()
|
||||||
gui.credentials <- ""
|
gui.credentials <- ""
|
||||||
return gui.returnFromContext()
|
return gui.c.PopContext()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleAskFocused() error {
|
func (gui *Gui) handleAskFocused() error {
|
||||||
|
@ -17,7 +17,7 @@ func (gui *Gui) handleCreateExtrasMenuPanel() error {
|
|||||||
OnPress: func() error {
|
OnPress: func() error {
|
||||||
currentContext := gui.currentStaticContext()
|
currentContext := gui.currentStaticContext()
|
||||||
if gui.ShowExtrasWindow && currentContext.GetKey() == context.COMMAND_LOG_CONTEXT_KEY {
|
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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ func (gui *Gui) getMenuOptions() map[string]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handleMenuClose() error {
|
func (gui *Gui) handleMenuClose() error {
|
||||||
return gui.returnFromContext()
|
return gui.c.PopContext()
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: items option is mutated by this function
|
// note: items option is mutated by this function
|
||||||
|
@ -26,7 +26,7 @@ func (gui *Gui) handleOpenSearch(viewName string) error {
|
|||||||
|
|
||||||
func (gui *Gui) handleSearch() error {
|
func (gui *Gui) handleSearch() error {
|
||||||
gui.State.Searching.searchString = gui.Views.Search.TextArea.GetContent()
|
gui.State.Searching.searchString = gui.Views.Search.TextArea.GetContent()
|
||||||
if err := gui.returnFromContext(); err != nil {
|
if err := gui.c.PopContext(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ func (gui *Gui) handleSearchEscape() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := gui.returnFromContext(); err != nil {
|
if err := gui.c.PopContext(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user