diff options
Diffstat (limited to 'pkg/gui/context/stash_context.go')
-rw-r--r-- | pkg/gui/context/stash_context.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pkg/gui/context/stash_context.go b/pkg/gui/context/stash_context.go index 19eb5030a..2c8f2e271 100644 --- a/pkg/gui/context/stash_context.go +++ b/pkg/gui/context/stash_context.go @@ -11,17 +11,16 @@ type StashContext struct { *ListContextTrait } -var _ types.IListContext = (*StashContext)(nil) +var ( + _ types.IListContext = (*StashContext)(nil) + _ types.DiffableContext = (*StashContext)(nil) +) func NewStashContext( getModel func() []*models.StashEntry, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, - onFocus func(types.OnFocusOpts) error, - onRenderToMain func() error, - onFocusLost func(opts types.OnFocusLostOpts) error, - c *types.HelperCommon, ) *StashContext { viewModel := NewBasicViewModel(getModel) @@ -35,11 +34,7 @@ func NewStashContext( Key: STASH_CONTEXT_KEY, Kind: types.SIDE_CONTEXT, Focusable: true, - }), ContextCallbackOpts{ - OnFocus: onFocus, - OnFocusLost: onFocusLost, - OnRenderToMain: onRenderToMain, - }), + }), ContextCallbackOpts{}), list: viewModel, getDisplayStrings: getDisplayStrings, c: c, @@ -67,3 +62,9 @@ func (self *StashContext) GetSelectedRef() types.Ref { } return stash } + +func (self *StashContext) GetDiffTerminals() []string { + itemId := self.GetSelectedItemId() + + return []string{itemId} +} |