From 524bf83a4a681408c3fb57818f6968cab632e0ae Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 13 Jun 2022 11:01:26 +1000 Subject: refactor to only have one context per view --- pkg/gui/context/sub_commits_context.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'pkg/gui/context/sub_commits_context.go') diff --git a/pkg/gui/context/sub_commits_context.go b/pkg/gui/context/sub_commits_context.go index a58502ad0..4070f0390 100644 --- a/pkg/gui/context/sub_commits_context.go +++ b/pkg/gui/context/sub_commits_context.go @@ -22,9 +22,9 @@ func NewSubCommitsContext( view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, - onFocus func(...types.OnFocusOpts) error, - onRenderToMain func(...types.OnFocusOpts) error, - onFocusLost func() error, + onFocus func(types.OnFocusOpts) error, + onRenderToMain func() error, + onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *SubCommitsContext { @@ -39,7 +39,7 @@ func NewSubCommitsContext( ViewportListContextTrait: &ViewportListContextTrait{ ListContextTrait: &ListContextTrait{ Context: NewSimpleContext(NewBaseContext(NewBaseContextOpts{ - ViewName: "subCommits", + View: view, WindowName: "branches", Key: SUB_COMMITS_CONTEXT_KEY, Kind: types.SIDE_CONTEXT, @@ -51,7 +51,6 @@ func NewSubCommitsContext( OnRenderToMain: onRenderToMain, }), list: viewModel, - viewTrait: NewViewTrait(view), getDisplayStrings: getDisplayStrings, c: c, }, -- cgit v1.2.3