summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-03-31 23:55:06 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-04-02 11:00:15 +1100
commit7d62f103e4a1b39b7e8fbd0e1f39815c525cd588 (patch)
tree83e331beeee07d066c76580e044234f18063a0a7 /pkg/gui/context.go
parent9e85d37fb949bbc83f28cb079f2ac4b45ae895ce (diff)
big refactor to give our enums actual types
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r--pkg/gui/context.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go
index c28fc9efc..91ec00fb1 100644
--- a/pkg/gui/context.go
+++ b/pkg/gui/context.go
@@ -6,8 +6,10 @@ import (
"github.com/jesseduffield/gocui"
)
+type ContextKind int
+
const (
- SIDE_CONTEXT int = iota
+ SIDE_CONTEXT ContextKind = iota
MAIN_CONTEXT
TEMPORARY_POPUP
PERSISTENT_POPUP
@@ -126,7 +128,7 @@ type Context interface {
HandleFocus() error
HandleFocusLost() error
HandleRender() error
- GetKind() int
+ GetKind() ContextKind
GetViewName() string
GetWindowName() string
SetWindowName(string)
@@ -143,7 +145,7 @@ type BasicContext struct {
OnFocusLost func() error
OnRender func() error
OnGetOptionsMap func() map[string]string
- Kind int
+ Kind ContextKind
Key string
ViewName string
}
@@ -194,7 +196,7 @@ func (c BasicContext) HandleFocusLost() error {
return nil
}
-func (c BasicContext) GetKind() int {
+func (c BasicContext) GetKind() ContextKind {
return c.Kind
}