From 43f4cacbcdb99d35fda6cfc16e04b2463302a06a Mon Sep 17 00:00:00 2001 From: derailed Date: Thu, 27 Feb 2020 21:54:45 -0700 Subject: [PATCH] cleaning up --- internal/view/log.go | 20 ++++++++++---------- internal/view/log_indicator.go | 21 ++++++++++++--------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/internal/view/log.go b/internal/view/log.go index 82381260..09fe4a49 100644 --- a/internal/view/log.go +++ b/internal/view/log.go @@ -172,7 +172,7 @@ func (l *Log) bindKeys() { ui.KeyC: ui.NewKeyAction("Clear", l.clearCmd, true), ui.KeyS: ui.NewKeyAction("Toggle AutoScroll", l.ToggleAutoScrollCmd, true), // BOZO!! Log timestamps - // ui.KeyT: ui.NewKeyAction("Toggle Timestamp", l.ToggleTimestampCmd, true), + // ui.KeyT: ui.NewKeyAction("Toggle Timestamp", l.toggleTimestampCmd, true), ui.KeyF: ui.NewKeyAction("FullScreen", l.fullScreenCmd, true), ui.KeyW: ui.NewKeyAction("Toggle Wrap", l.textWrapCmd, true), tcell.KeyCtrlS: ui.NewKeyAction("Save", l.SaveCmd, true), @@ -355,16 +355,16 @@ func (l *Log) textWrapCmd(*tcell.EventKey) *tcell.EventKey { return nil } -// ToggleTimeStampCmd toggles timestamp field. -func (l *Log) ToggleTimestampCmd(evt *tcell.EventKey) *tcell.EventKey { - l.model.Clear() - l.indicator.ToggleTimestamp() - l.model.ShowTimestamp(l.indicator.Timestamp()) - l.model.Stop() - l.model.Start() +// BOZO! Log timestamps. +// func (l *Log) toggleTimestampCmd(evt *tcell.EventKey) *tcell.EventKey { +// l.model.Clear() +// l.indicator.ToggleTimestamp() +// l.model.ShowTimestamp(l.indicator.Timestamp()) +// l.model.Stop() +// l.model.Start() - return nil -} +// return nil +// } // ToggleAutoScrollCmd toggles autoscroll status. func (l *Log) ToggleAutoScrollCmd(evt *tcell.EventKey) *tcell.EventKey { diff --git a/internal/view/log_indicator.go b/internal/view/log_indicator.go index ed1dc656..dc714ef3 100644 --- a/internal/view/log_indicator.go +++ b/internal/view/log_indicator.go @@ -16,7 +16,8 @@ type LogIndicator struct { scrollStatus int32 fullScreen bool textWrap bool - showTime bool + // BOZO!! timestamp + // showTime bool } // NewLogIndicator returns a new indicator. @@ -39,10 +40,11 @@ func (l *LogIndicator) AutoScroll() bool { return atomic.LoadInt32(&l.scrollStatus) == 1 } -// TextWrap reports the current wrap mode. -func (l *LogIndicator) Timestamp() bool { - return l.showTime -} +// BOZO!! Timestamp +// // Timestamp reports the current timestamp mode. +// func (l *LogIndicator) Timestamp() bool { +// return l.showTime +// } // TextWrap reports the current wrap mode. func (l *LogIndicator) TextWrap() bool { @@ -54,10 +56,11 @@ func (l *LogIndicator) FullScreen() bool { return l.fullScreen } -// TextWrap reports the current wrap mode. -func (l *LogIndicator) ToggleTimestamp() { - l.showTime = !l.showTime -} +// BOZO!! Timestamp +// // TextWrap reports the current wrap mode. +// func (l *LogIndicator) ToggleTimestamp() { +// l.showTime = !l.showTime +// } // ToggleFullScreen toggles the screen mode. func (l *LogIndicator) ToggleFullScreen() {