Browse Source

main: shorten size poll time from 500ms to 25ms

Benton Edmondson 1 year ago
parent
commit
f05a7e7b49
2 changed files with 2 additions and 1 deletions
  1. 1 1
      main.go
  2. 1 0
      ui/ui.go

+ 1 - 1
main.go

@@ -28,7 +28,7 @@ func main() {
 	state := ui.NewState(width, height, printRaw)
 	go func() {
 		for {
-			time.Sleep(500 * time.Millisecond)
+			time.Sleep(25 * time.Millisecond)
 			width, height, err := term.GetSize(int(os.Stdin.Fd()))
 			if err != nil {
 				panic(err)

+ 1 - 0
ui/ui.go

@@ -186,6 +186,7 @@ func (s *State) Update(input byte) {
 			} else {
 				s.buffer = ""
 				s.mode = normal
+				s.output(s.view())
 			}
 			return
 		}