diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-27 19:08:05 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-27 19:18:07 +1100 |
commit | b3636a537b77a21268bf20810494e7fd9553841f (patch) | |
tree | 55383120fa29e8036eaaa83554fd881002adc143 /pkg/gui | |
parent | 48a244a9238e7f119903db24900421605bbf5eff (diff) |
reduce glitchiness of patch building mode
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/commit_files_panel.go | 9 | ||||
-rw-r--r-- | pkg/gui/patch_building_panel.go | 4 | ||||
-rw-r--r-- | 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() } |