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

refactor of contexts and filtering

This commit is contained in:
Jesse Duffield
2021-04-03 11:32:14 +11:00
parent 5289d49f75
commit bc9a99387f
35 changed files with 299 additions and 334 deletions

View File

@ -42,7 +42,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu() error {
},
}...)
if gui.currentContext().GetKey() == gui.Contexts.BranchCommits.Context.GetKey() {
if gui.currentContext().GetKey() == gui.Contexts.BranchCommits.GetKey() {
selectedCommit := gui.getSelectedLocalCommit()
if selectedCommit != nil && gui.GitCommand.PatchManager.To != selectedCommit.Sha {
// adding this option to index 1
@ -179,7 +179,7 @@ func (gui *Gui) handleApplyPatch(reverse bool) error {
func (gui *Gui) handleResetPatch() error {
gui.GitCommand.PatchManager.Reset()
if gui.currentContextKeyIgnoringPopups() == MAIN_PATCH_BUILDING_CONTEXT_KEY {
if err := gui.pushContext(gui.Contexts.CommitFiles.Context); err != nil {
if err := gui.pushContext(gui.Contexts.CommitFiles); err != nil {
return err
}
}