diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-29 19:15:46 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | e363606fb6eeff130e38466f5a63a3a8c0e6ec0d (patch) | |
tree | 3af2946729ffc2e718daaa54f1338614be832251 /pkg/gui/context.go | |
parent | 138be04e6575f2bd087630e49d122af578c78bf6 (diff) |
move context keys into context package
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r-- | pkg/gui/context.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go index f92c73e26..1c115c04b 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/jesseduffield/gocui" + "github.com/jesseduffield/lazygit/pkg/gui/context" "github.com/jesseduffield/lazygit/pkg/gui/types" ) @@ -130,7 +131,7 @@ func (gui *Gui) deactivateContext(c types.Context) error { } // if we are the kind of context that is sent to back upon deactivation, we should do that - if view != nil && (c.GetKind() == types.TEMPORARY_POPUP || c.GetKind() == types.PERSISTENT_POPUP || c.GetKey() == COMMIT_FILES_CONTEXT_KEY) { + if view != nil && (c.GetKind() == types.TEMPORARY_POPUP || c.GetKind() == types.PERSISTENT_POPUP || c.GetKey() == context.COMMIT_FILES_CONTEXT_KEY) { view.Visible = false } @@ -181,7 +182,7 @@ func (gui *Gui) activateContext(c types.Context, opts ...types.OnFocusOpts) erro if viewName == "main" { gui.changeMainViewsContext(c.GetKey()) } else { - gui.changeMainViewsContext(MAIN_NORMAL_CONTEXT_KEY) + gui.changeMainViewsContext(context.MAIN_NORMAL_CONTEXT_KEY) } gui.setViewTabForContext(c) @@ -382,7 +383,7 @@ func (gui *Gui) changeMainViewsContext(contextKey types.ContextKey) { } switch contextKey { - case MAIN_NORMAL_CONTEXT_KEY, MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY, MAIN_MERGING_CONTEXT_KEY: + case context.MAIN_NORMAL_CONTEXT_KEY, context.MAIN_PATCH_BUILDING_CONTEXT_KEY, context.MAIN_STAGING_CONTEXT_KEY, context.MAIN_MERGING_CONTEXT_KEY: gui.Views.Main.Context = string(contextKey) gui.Views.Secondary.Context = string(contextKey) default: |