summaryrefslogtreecommitdiffstats
path: root/pkg/gui/diff_context_size.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-29 19:15:46 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:13:40 +1100
commite363606fb6eeff130e38466f5a63a3a8c0e6ec0d (patch)
tree3af2946729ffc2e718daaa54f1338614be832251 /pkg/gui/diff_context_size.go
parent138be04e6575f2bd087630e49d122af578c78bf6 (diff)
move context keys into context package
Diffstat (limited to 'pkg/gui/diff_context_size.go')
-rw-r--r--pkg/gui/diff_context_size.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/pkg/gui/diff_context_size.go b/pkg/gui/diff_context_size.go
index 5caefd032..e16b26852 100644
--- a/pkg/gui/diff_context_size.go
+++ b/pkg/gui/diff_context_size.go
@@ -3,17 +3,18 @@ package gui
import (
"errors"
+ "github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
var CONTEXT_KEYS_SHOWING_DIFFS = []types.ContextKey{
- FILES_CONTEXT_KEY,
- COMMIT_FILES_CONTEXT_KEY,
- STASH_CONTEXT_KEY,
- BRANCH_COMMITS_CONTEXT_KEY,
- SUB_COMMITS_CONTEXT_KEY,
- MAIN_STAGING_CONTEXT_KEY,
- MAIN_PATCH_BUILDING_CONTEXT_KEY,
+ context.FILES_CONTEXT_KEY,
+ context.COMMIT_FILES_CONTEXT_KEY,
+ context.STASH_CONTEXT_KEY,
+ context.BRANCH_COMMITS_CONTEXT_KEY,
+ context.SUB_COMMITS_CONTEXT_KEY,
+ context.MAIN_STAGING_CONTEXT_KEY,
+ context.MAIN_PATCH_BUILDING_CONTEXT_KEY,
}
func isShowingDiff(gui *Gui) bool {
@@ -59,9 +60,9 @@ 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:
+ case context.MAIN_PATCH_BUILDING_CONTEXT_KEY:
return gui.handleRefreshPatchBuildingPanel(-1)
- case MAIN_STAGING_CONTEXT_KEY:
+ case context.MAIN_STAGING_CONTEXT_KEY:
return gui.handleRefreshStagingPanel(false, -1)
default:
return currentContext.HandleRenderToMain()