summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/types/context.go')
-rw-r--r--pkg/gui/types/context.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go
index e88d0d0f9..ef57e06bc 100644
--- a/pkg/gui/types/context.go
+++ b/pkg/gui/types/context.go
@@ -72,6 +72,10 @@ type IBaseContext interface {
// our list controller can come along and wrap it in a list-specific click handler.
// We'll need to think of a better way to do this.
AddOnClickFn(func() error)
+
+ AddOnRenderToMainFn(func() error)
+ AddOnFocusFn(func(OnFocusOpts) error)
+ AddOnFocusLostFn(func(OnFocusLostOpts) error)
}
type Context interface {
@@ -83,6 +87,16 @@ type Context interface {
HandleRenderToMain() error
}
+type DiffableContext interface {
+ Context
+
+ // Returns the current diff terminals of the currently selected item.
+ // in the case of a branch it returns both the branch and it's upstream name,
+ // which becomes an option when you bring up the diff menu, but when you're just
+ // flicking through branches it will be using the local branch name.
+ GetDiffTerminals() []string
+}
+
type IListContext interface {
Context
@@ -150,6 +164,9 @@ type HasKeybindings interface {
GetKeybindings(opts KeybindingsOpts) []*Binding
GetMouseKeybindings(opts KeybindingsOpts) []*gocui.ViewMouseBinding
GetOnClick() func() error
+ GetOnRenderToMain() func() error
+ GetOnFocus() func(OnFocusOpts) error
+ GetOnFocusLost() func(OnFocusLostOpts) error
}
type IController interface {