diff options
author | Sean E. Russell <ser@ser1.net> | 2020-04-27 20:33:41 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-04-27 20:33:41 -0500 |
commit | 285d4d02972e5d3e52efa6554fcbb08b42577f7c (patch) | |
tree | a06df20b360abdbc011b697e01e7ac9df5022117 /widgets/help.go | |
parent | 1e78e6faa096237440e9cbbe254951f6d8588624 (diff) |
Go vet/lint cleanups
Diffstat (limited to 'widgets/help.go')
-rw-r--r-- | widgets/help.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/widgets/help.go b/widgets/help.go index 012ca9d..a2c38e4 100644 --- a/widgets/help.go +++ b/widgets/help.go @@ -7,6 +7,7 @@ import ( ui "github.com/gizak/termui/v3" ) +// KEYBINDS is the help text for the in-program shortcuts const KEYBINDS = ` Quit: q or <C-c> @@ -55,7 +56,7 @@ func NewHelpMenu() *HelpMenu { } } -func (self *HelpMenu) Resize(termWidth, termHeight int) { +func (help *HelpMenu) Resize(termWidth, termHeight int) { textWidth := 53 for _, line := range strings.Split(KEYBINDS, "\n") { if textWidth < len(line) { @@ -66,17 +67,17 @@ func (self *HelpMenu) Resize(termWidth, termHeight int) { x := (termWidth - textWidth) / 2 y := (termHeight - textHeight) / 2 - self.Block.SetRect(x, y, textWidth+x, textHeight+y) + help.Block.SetRect(x, y, textWidth+x, textHeight+y) } -func (self *HelpMenu) Draw(buf *ui.Buffer) { - self.Block.Draw(buf) +func (help *HelpMenu) Draw(buf *ui.Buffer) { + help.Block.Draw(buf) for y, line := range strings.Split(KEYBINDS, "\n") { for x, rune := range line { buf.SetCell( ui.NewCell(rune, ui.Theme.Default), - image.Pt(self.Inner.Min.X+x, self.Inner.Min.Y+y-1), + image.Pt(help.Inner.Min.X+x, help.Inner.Min.Y+y-1), ) } } |