summaryrefslogtreecommitdiffstats
path: root/pkg/gui/diff_context_size.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-18 20:43:08 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-18 21:25:52 +1100
commitb6fb7f13657435a789b39eabfc4414d2ec203588 (patch)
treee06a99517ba4eb032503d55033e88236fad10efe /pkg/gui/diff_context_size.go
parentdbb8b17d839cea811238f2575474f97176bc90a1 (diff)
fix integration test
Diffstat (limited to 'pkg/gui/diff_context_size.go')
-rw-r--r--pkg/gui/diff_context_size.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/pkg/gui/diff_context_size.go b/pkg/gui/diff_context_size.go
index ff7786c8a..3b6f6b0a9 100644
--- a/pkg/gui/diff_context_size.go
+++ b/pkg/gui/diff_context_size.go
@@ -32,7 +32,7 @@ func (gui *Gui) IncreaseContextInDiffView() error {
}
gui.UserConfig.Git.DiffContextSize = gui.UserConfig.Git.DiffContextSize + 1
- return gui.currentStaticContext().HandleRenderToMain()
+ return gui.handleDiffContextSizeChange()
}
return nil
@@ -47,12 +47,25 @@ func (gui *Gui) DecreaseContextInDiffView() error {
}
gui.UserConfig.Git.DiffContextSize = old_size - 1
- return gui.currentStaticContext().HandleRenderToMain()
+ return gui.handleDiffContextSizeChange()
}
return nil
}
+func (gui *Gui) handleDiffContextSizeChange() error {
+ currentContext := gui.currentStaticContext()
+ switch currentContext.GetKey() {
+ // we make an exception for our staging and patch building contexts because they actually need to refresh their state afterwards.
+ case MAIN_PATCH_BUILDING_CONTEXT_KEY:
+ return gui.handleRefreshPatchBuildingPanel(-1)
+ case MAIN_STAGING_CONTEXT_KEY:
+ return gui.handleRefreshStagingPanel(false, -1)
+ default:
+ return currentContext.HandleRenderToMain()
+ }
+}
+
func (gui *Gui) CheckCanChangeContext() error {
if gui.Git.Patch.PatchManager.Active() {
return errors.New(gui.Tr.CantChangeContextSizeError)