cleaning up
parent
c896598e84
commit
43f4cacbcd
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue