From 772e0aa3f9242ebf0dc5a62831208bfc8df604e5 Mon Sep 17 00:00:00 2001 From: derailed Date: Mon, 23 Mar 2020 18:41:03 -0600 Subject: [PATCH] cleaning up --- internal/color/colorize.go | 1 + internal/config/logger.go | 2 +- internal/model/fish_buff.go | 2 +- internal/model/log.go | 1 + internal/ui/app.go | 1 + internal/view/log.go | 2 ++ 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/color/colorize.go b/internal/color/colorize.go index 779d3d3e..72be9de5 100644 --- a/internal/color/colorize.go +++ b/internal/color/colorize.go @@ -4,6 +4,7 @@ import ( "fmt" ) +// ColorFmt colorize a string with ansi colors. const ColorFmt = "\x1b[%dm%s\x1b[0m" // Paint describes a terminal color. diff --git a/internal/config/logger.go b/internal/config/logger.go index 23b898ad..297a997a 100644 --- a/internal/config/logger.go +++ b/internal/config/logger.go @@ -8,7 +8,7 @@ const ( // DefaultLoggerTailCount tracks default log tail size. DefaultLoggerTailCount = 100 // MaxLogThreshold sets the max value for log size. - MaxLogThreshold = 5_000 + MaxLogThreshold = 5000 // DefaultSinceSeconds tracks default log age. DefaultSinceSeconds = 5 * 60 // 5mins ) diff --git a/internal/model/fish_buff.go b/internal/model/fish_buff.go index ca052353..b3cbe0ca 100644 --- a/internal/model/fish_buff.go +++ b/internal/model/fish_buff.go @@ -22,7 +22,7 @@ type FishBuff struct { suggestionFn SuggestionFunc } -// NewFishBuffer returns a new command buffer. +// NewFishBuff returns a new command buffer. func NewFishBuff(key rune, kind BufferKind) *FishBuff { return &FishBuff{CmdBuff: NewCmdBuff(key, kind)} } diff --git a/internal/model/log.go b/internal/model/log.go index fe491614..9fa20000 100644 --- a/internal/model/log.go +++ b/internal/model/log.go @@ -62,6 +62,7 @@ func (l *Log) SinceSeconds() int64 { return l.logOptions.SinceSeconds } +// SetLogOptions updates logger options. func (l *Log) SetLogOptions(opts dao.LogOptions) { l.logOptions = opts l.Restart() diff --git a/internal/ui/app.go b/internal/ui/app.go index 8beeeab7..79ceb594 100644 --- a/internal/ui/app.go +++ b/internal/ui/app.go @@ -70,6 +70,7 @@ func (a *App) BufferActive(state bool, _ model.BufferKind) { a.Draw() } +// SuggestionChanged notifies of update to command suggestions. func (a *App) SuggestionChanged(ss []string) {} // StylesChanged notifies the skin changed. diff --git a/internal/view/log.go b/internal/view/log.go index 7fdfed30..73fc33fe 100644 --- a/internal/view/log.go +++ b/internal/view/log.go @@ -190,12 +190,14 @@ func (l *Log) bindKeys() { }) } +// SendStrokes (testing only!) func (l *Log) SendStrokes(s string) { for _, r := range s { l.logs.keyboard(tcell.NewEventKey(tcell.KeyRune, r, tcell.ModNone)) } } +// SendKeys (testing only!) func (l *Log) SendKeys(kk ...tcell.Key) { for _, k := range kk { l.logs.keyboard(tcell.NewEventKey(k, ' ', tcell.ModNone))