From 5557af8306259cdadb73ce7c60ed7bf27a6265db Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Sun, 10 Jul 2022 14:57:11 +0200 Subject: [PATCH] refactor: improve enum definitions --- cursor.go | 6 +++--- jumpmarks.go | 6 +++--- notification.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cursor.go b/cursor.go index 980bbdf..e5333ca 100644 --- a/cursor.go +++ b/cursor.go @@ -33,14 +33,14 @@ type CursorsState struct { ForceVisible bool } +type Cursor int + const ( - cursorNone = iota + cursorNone Cursor = iota cursorDefault cursorGrabbing ) -type Cursor int - type CursorCache = map[Cursor]*gdk.Cursor func (cursor *CursorsState) init() { diff --git a/jumpmarks.go b/jumpmarks.go index 2310b6f..d3e659d 100644 --- a/jumpmarks.go +++ b/jumpmarks.go @@ -39,13 +39,13 @@ type JumpmarksCycle struct { dontClear bool } +type JumpmarkCycleDirection int + const ( - cycleDirectionBackward = iota + cycleDirectionBackward JumpmarkCycleDirection = iota cycleDirectionForward ) -type JumpmarkCycleDirection int - func (jumpmarks Jumpmarks) has(page int) bool { for _, mark := range jumpmarks.list { // ASSUMPTION: The slice is sorted diff --git a/notification.go b/notification.go index 573d75e..af82828 100644 --- a/notification.go +++ b/notification.go @@ -31,7 +31,7 @@ var ( type NotificationLength = int const ( - ShortNotification = iota + ShortNotification NotificationLength = iota LongNotification )