MCPcopy Create free account
hub / github.com/Enapiuz/multiwatch / padToTop

Method padToTop

printer/printer.go:103–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101}
102
103func (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}

Callers 1

StartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected