()
| 101 | } |
| 102 | |
| 103 | func (p *Printer) padToTop() { |
| 104 | y, err := terminal.Height() |
| 105 | if err == nil { |
| 106 | toRepeat := int(y) - len(p.watchers) - 1 |
| 107 | if toRepeat < 0 { |
| 108 | toRepeat = 0 |
| 109 | } |
| 110 | fmt.Print(strings.Repeat("\n", toRepeat)) |
| 111 | } |
| 112 | x, err := terminal.Width() |
| 113 | if err == nil { |
| 114 | toRepeat := int(x) - 1 |
| 115 | if toRepeat < 0 { |
| 116 | toRepeat = 0 |
| 117 | } |
| 118 | fmt.Print(strings.Repeat(" ", toRepeat)) |
| 119 | } |
| 120 | } |