cleaning up

mine
derailed 2020-03-23 18:41:03 -06:00
parent df43153110
commit 772e0aa3f9
6 changed files with 7 additions and 2 deletions

View File

@ -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.

View File

@ -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
)

View File

@ -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)}
}

View File

@ -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()

View File

@ -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.

View File

@ -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))