clean up flushing

master
Bel LaPointe 2020-02-17 15:19:38 -07:00
parent 6fa61b3d2f
commit 4835c24868
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,6 @@
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
@ -54,11 +53,12 @@ func listen(k *Keyboard, tp *TickPrinter, timer *Timer, stop func()) {
case 'S':
timer.Sub(time.Minute)
case 'p':
tp.Flush()
timer.TogglePause()
case 'z':
fmt.Printf("\n")
tp.Flush()
case 'r':
tp.Flush()
timer.Reset()
case 'q':
stop()

View File

@ -32,6 +32,7 @@ func (t *TickPrinter) Start() {
for {
select {
case <-t.flush:
fmt.Printf("\n")
t.Print()
case <-ticker.C:
t.Print()