From b3636a537b77a21268bf20810494e7fd9553841f Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 27 Mar 2022 19:08:05 +1100 Subject: [PATCH] reduce glitchiness of patch building mode --- pkg/gui/commit_files_panel.go | 9 --------- pkg/gui/patch_building_panel.go | 4 ++++ pkg/gui/patch_options_panel.go | 5 +++++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go index a93486b07..7bb78b4bc 100644 --- a/pkg/gui/commit_files_panel.go +++ b/pkg/gui/commit_files_panel.go @@ -1,7 +1,6 @@ package gui import ( - "github.com/jesseduffield/lazygit/pkg/gui/context" "github.com/jesseduffield/lazygit/pkg/gui/controllers" ) @@ -54,14 +53,6 @@ func (gui *Gui) SwitchToCommitFilesContext(opts controllers.SwitchToCommitFilesC } func (gui *Gui) refreshCommitFilesContext() error { - currentSideContext := gui.currentSideContext() - if currentSideContext.GetKey() == context.COMMIT_FILES_CONTEXT_KEY || - currentSideContext.GetKey() == context.LOCAL_COMMITS_CONTEXT_KEY { - if err := gui.handleRefreshPatchBuildingPanel(-1); err != nil { - return err - } - } - to := gui.State.Contexts.CommitFiles.GetRefName() from, reverse := gui.State.Modes.Diffing.GetFromAndReverseArgsForDiff(to) diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go index b2c3c4ab2..f1aea7b55 100644 --- a/pkg/gui/patch_building_panel.go +++ b/pkg/gui/patch_building_panel.go @@ -90,6 +90,10 @@ func (gui *Gui) handleToggleSelectionForPatch() error { return err } + if err := gui.handleRefreshPatchBuildingPanel(-1); err != nil { + return err + } + if err := gui.refreshCommitFilesContext(); err != nil { return err } diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go index d8ac509ac..c8cfd76d1 100644 --- a/pkg/gui/patch_options_panel.go +++ b/pkg/gui/patch_options_panel.go @@ -201,5 +201,10 @@ func (gui *Gui) handleResetPatch() error { return err } } + + if err := gui.handleEscapePatchBuildingPanel(); err != nil { + return err + } + return gui.refreshCommitFilesContext() }