1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-23 22:24:51 +02:00

rename merging context to mergeConflicts

This commit is contained in:
Jesse Duffield
2022-08-06 18:05:00 +10:00
parent cd2c01d1cf
commit 445a625b56
16 changed files with 215 additions and 133 deletions

View File

@@ -10,7 +10,7 @@ func (gui *Gui) contextTree() *context.ContextTree {
Global: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{
Kind: types.GLOBAL_CONTEXT,
View: nil,
View: nil, // TODO: see if this breaks anything
WindowName: "",
Key: context.GLOBAL_CONTEXT_KEY,
Focusable: false,
@@ -158,27 +158,22 @@ func (gui *Gui) contextTree() *context.ContextTree {
}),
context.ContextCallbackOpts{},
),
Merging: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{
Kind: types.MAIN_CONTEXT,
View: gui.Views.Merging,
WindowName: "main",
Key: context.MERGING_MAIN_CONTEXT_KEY,
OnGetOptionsMap: gui.getMergingOptions,
Focusable: true,
}),
MergeConflicts: context.NewMergeConflictsContext(
gui.Views.MergeConflicts,
context.ContextCallbackOpts{
OnFocus: OnFocusWrapper(func() error {
gui.Views.Merging.Wrap = false
gui.Views.MergeConflicts.Wrap = false
return gui.renderConflictsWithLock(true)
}),
OnFocusLost: func(types.OnFocusLostOpts) error {
gui.Views.Merging.Wrap = true
gui.Views.MergeConflicts.Wrap = true
return nil
},
},
gui.c,
gui.getMergingOptions,
),
Confirmation: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{