summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/context/branches_context.go2
-rw-r--r--pkg/gui/context/commit_files_context.go2
-rw-r--r--pkg/gui/context/commit_message_context.go1
-rw-r--r--pkg/gui/context/confirmation_context.go2
-rw-r--r--pkg/gui/context/local_commits_context.go2
-rw-r--r--pkg/gui/context/menu_context.go2
-rw-r--r--pkg/gui/context/merge_conflicts_context.go3
-rw-r--r--pkg/gui/context/patch_explorer_context.go2
-rw-r--r--pkg/gui/context/reflog_commits_context.go2
-rw-r--r--pkg/gui/context/remote_branches_context.go2
-rw-r--r--pkg/gui/context/remotes_context.go2
-rw-r--r--pkg/gui/context/simple_context.go13
-rw-r--r--pkg/gui/context/stash_context.go2
-rw-r--r--pkg/gui/context/sub_commits_context.go2
-rw-r--r--pkg/gui/context/submodules_context.go2
-rw-r--r--pkg/gui/context/suggestions_context.go2
-rw-r--r--pkg/gui/context/tags_context.go2
-rw-r--r--pkg/gui/context/working_tree_context.go2
-rw-r--r--pkg/gui/context_config.go9
19 files changed, 16 insertions, 40 deletions
diff --git a/pkg/gui/context/branches_context.go b/pkg/gui/context/branches_context.go
index f0d356a15..05feed145 100644
--- a/pkg/gui/context/branches_context.go
+++ b/pkg/gui/context/branches_context.go
@@ -34,7 +34,7 @@ func NewBranchesContext(
Key: LOCAL_BRANCHES_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/commit_files_context.go b/pkg/gui/context/commit_files_context.go
index c2de8b448..92ff153b3 100644
--- a/pkg/gui/context/commit_files_context.go
+++ b/pkg/gui/context/commit_files_context.go
@@ -40,7 +40,7 @@ func NewCommitFilesContext(
Focusable: true,
Transient: true,
}),
- ContextCallbackOpts{}),
+ ),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/commit_message_context.go b/pkg/gui/context/commit_message_context.go
index 42e0de5f1..b7224341d 100644
--- a/pkg/gui/context/commit_message_context.go
+++ b/pkg/gui/context/commit_message_context.go
@@ -29,7 +29,6 @@ func NewCommitMessageContext(
Focusable: true,
HasUncontrolledBounds: true,
}),
- ContextCallbackOpts{},
),
}
}
diff --git a/pkg/gui/context/confirmation_context.go b/pkg/gui/context/confirmation_context.go
index 0224fb0f0..34ec3ce6f 100644
--- a/pkg/gui/context/confirmation_context.go
+++ b/pkg/gui/context/confirmation_context.go
@@ -30,6 +30,6 @@ func NewConfirmationContext(
Kind: types.TEMPORARY_POPUP,
Focusable: true,
HasUncontrolledBounds: true,
- }), ContextCallbackOpts{}),
+ })),
}
}
diff --git a/pkg/gui/context/local_commits_context.go b/pkg/gui/context/local_commits_context.go
index de306f0d2..b700a39af 100644
--- a/pkg/gui/context/local_commits_context.go
+++ b/pkg/gui/context/local_commits_context.go
@@ -35,7 +35,7 @@ func NewLocalCommitsContext(
Key: LOCAL_COMMITS_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/menu_context.go b/pkg/gui/context/menu_context.go
index 070ec3392..288016f8d 100644
--- a/pkg/gui/context/menu_context.go
+++ b/pkg/gui/context/menu_context.go
@@ -29,7 +29,7 @@ func NewMenuContext(
Kind: types.TEMPORARY_POPUP,
Focusable: true,
HasUncontrolledBounds: true,
- }), ContextCallbackOpts{}),
+ })),
getDisplayStrings: viewModel.GetDisplayStrings,
list: viewModel,
c: c,
diff --git a/pkg/gui/context/merge_conflicts_context.go b/pkg/gui/context/merge_conflicts_context.go
index 4066805bb..72dc7761e 100644
--- a/pkg/gui/context/merge_conflicts_context.go
+++ b/pkg/gui/context/merge_conflicts_context.go
@@ -27,8 +27,6 @@ type ConflictsViewModel struct {
func NewMergeConflictsContext(
view *gocui.View,
- opts ContextCallbackOpts,
-
c *types.HelperCommon,
) *MergeConflictsContext {
viewModel := &ConflictsViewModel{
@@ -48,7 +46,6 @@ func NewMergeConflictsContext(
Focusable: true,
HighlightOnFocus: true,
}),
- opts,
),
c: c,
}
diff --git a/pkg/gui/context/patch_explorer_context.go b/pkg/gui/context/patch_explorer_context.go
index 272784a9c..216381dcd 100644
--- a/pkg/gui/context/patch_explorer_context.go
+++ b/pkg/gui/context/patch_explorer_context.go
@@ -41,7 +41,7 @@ func NewPatchExplorerContext(
Kind: types.MAIN_CONTEXT,
Focusable: true,
HighlightOnFocus: true,
- }), ContextCallbackOpts{}),
+ })),
}
}
diff --git a/pkg/gui/context/reflog_commits_context.go b/pkg/gui/context/reflog_commits_context.go
index 512aabfe0..920699d21 100644
--- a/pkg/gui/context/reflog_commits_context.go
+++ b/pkg/gui/context/reflog_commits_context.go
@@ -34,7 +34,7 @@ func NewReflogCommitsContext(
Key: REFLOG_COMMITS_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/remote_branches_context.go b/pkg/gui/context/remote_branches_context.go
index 563255508..fc185c953 100644
--- a/pkg/gui/context/remote_branches_context.go
+++ b/pkg/gui/context/remote_branches_context.go
@@ -37,7 +37,7 @@ func NewRemoteBranchesContext(
Kind: types.SIDE_CONTEXT,
Focusable: true,
Transient: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/remotes_context.go b/pkg/gui/context/remotes_context.go
index 62c7241c6..cb3476a4e 100644
--- a/pkg/gui/context/remotes_context.go
+++ b/pkg/gui/context/remotes_context.go
@@ -34,7 +34,7 @@ func NewRemotesContext(
Key: REMOTES_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/simple_context.go b/pkg/gui/context/simple_context.go
index 7ded4bd68..7c00e09f7 100644
--- a/pkg/gui/context/simple_context.go
+++ b/pkg/gui/context/simple_context.go
@@ -6,18 +6,11 @@ import (
)
type SimpleContext struct {
- OnRender func() error
-
*BaseContext
}
-type ContextCallbackOpts struct {
- OnRender func() error
-}
-
-func NewSimpleContext(baseContext *BaseContext, opts ContextCallbackOpts) *SimpleContext {
+func NewSimpleContext(baseContext *BaseContext) *SimpleContext {
return &SimpleContext{
- OnRender: opts.OnRender,
BaseContext: baseContext,
}
}
@@ -35,7 +28,6 @@ func NewDisplayContext(key types.ContextKey, view *gocui.View, windowName string
Focusable: false,
Transient: false,
}),
- ContextCallbackOpts{},
)
}
@@ -67,9 +59,6 @@ func (self *SimpleContext) HandleFocusLost(opts types.OnFocusLostOpts) error {
}
func (self *SimpleContext) HandleRender() error {
- if self.OnRender != nil {
- return self.OnRender()
- }
return nil
}
diff --git a/pkg/gui/context/stash_context.go b/pkg/gui/context/stash_context.go
index 2c8f2e271..7d5891be8 100644
--- a/pkg/gui/context/stash_context.go
+++ b/pkg/gui/context/stash_context.go
@@ -34,7 +34,7 @@ func NewStashContext(
Key: STASH_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/sub_commits_context.go b/pkg/gui/context/sub_commits_context.go
index ba3002d99..f4bf2360f 100644
--- a/pkg/gui/context/sub_commits_context.go
+++ b/pkg/gui/context/sub_commits_context.go
@@ -45,7 +45,7 @@ func NewSubCommitsContext(
Kind: types.SIDE_CONTEXT,
Focusable: true,
Transient: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/submodules_context.go b/pkg/gui/context/submodules_context.go
index 9b2f3331b..acc1d6ef0 100644
--- a/pkg/gui/context/submodules_context.go
+++ b/pkg/gui/context/submodules_context.go
@@ -31,7 +31,7 @@ func NewSubmodulesContext(
Key: SUBMODULES_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/suggestions_context.go b/pkg/gui/context/suggestions_context.go
index 8a28ce514..744219843 100644
--- a/pkg/gui/context/suggestions_context.go
+++ b/pkg/gui/context/suggestions_context.go
@@ -53,7 +53,7 @@ func NewSuggestionsContext(
Kind: types.PERSISTENT_POPUP,
Focusable: true,
HasUncontrolledBounds: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/tags_context.go b/pkg/gui/context/tags_context.go
index a9e05627d..b276516eb 100644
--- a/pkg/gui/context/tags_context.go
+++ b/pkg/gui/context/tags_context.go
@@ -34,7 +34,7 @@ func NewTagsContext(
Key: TAGS_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context/working_tree_context.go b/pkg/gui/context/working_tree_context.go
index 900158320..29b255cd3 100644
--- a/pkg/gui/context/working_tree_context.go
+++ b/pkg/gui/context/working_tree_context.go
@@ -32,7 +32,7 @@ func NewWorkingTreeContext(
Key: FILES_CONTEXT_KEY,
Kind: types.SIDE_CONTEXT,
Focusable: true,
- }), ContextCallbackOpts{}),
+ })),
list: viewModel,
getDisplayStrings: getDisplayStrings,
c: c,
diff --git a/pkg/gui/context_config.go b/pkg/gui/context_config.go
index 994fc8a32..4324df137 100644
--- a/pkg/gui/context_config.go
+++ b/pkg/gui/context_config.go
@@ -17,7 +17,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Focusable: false,
HasUncontrolledBounds: true, // setting to true because the global context doesn't even have a view
}),
- context.ContextCallbackOpts{},
),
Status: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{
@@ -27,7 +26,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.STATUS_CONTEXT_KEY,
Focusable: true,
}),
- context.ContextCallbackOpts{},
),
Snake: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{
@@ -37,7 +35,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.SNAKE_CONTEXT_KEY,
Focusable: true,
}),
- context.ContextCallbackOpts{},
),
Files: gui.filesListContext(),
Submodules: gui.submodulesListContext(),
@@ -60,7 +57,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.NORMAL_MAIN_CONTEXT_KEY,
Focusable: false,
}),
- context.ContextCallbackOpts{},
),
NormalSecondary: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{
@@ -70,7 +66,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.NORMAL_SECONDARY_CONTEXT_KEY,
Focusable: false,
}),
- context.ContextCallbackOpts{},
),
Staging: context.NewPatchExplorerContext(
gui.Views.Staging,
@@ -110,11 +105,9 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.PATCH_BUILDING_SECONDARY_CONTEXT_KEY,
Focusable: false,
}),
- context.ContextCallbackOpts{},
),
MergeConflicts: context.NewMergeConflictsContext(
gui.Views.MergeConflicts,
- context.ContextCallbackOpts{},
gui.c,
),
Confirmation: context.NewConfirmationContext(gui.c),
@@ -127,7 +120,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.SEARCH_CONTEXT_KEY,
Focusable: true,
}),
- context.ContextCallbackOpts{},
),
CommandLog: context.NewSimpleContext(
context.NewBaseContext(context.NewBaseContextOpts{
@@ -137,7 +129,6 @@ func (gui *Gui) contextTree() *context.ContextTree {
Key: context.COMMAND_LOG_CONTEXT_KEY,
Focusable: true,
}),
- context.ContextCallbackOpts{},
),
Options: context.NewDisplayContext(context.OPTIONS_CONTEXT_KEY, gui.Views.Options, "options"),
AppStatus: context.NewDisplayContext(context.APP_STATUS_CONTEXT_KEY, gui.Views.AppStatus, "appStatus"),