|
|
@ -7,7 +7,7 @@ import ( |
|
|
|
|
|
|
|
// Clear clears the screen.
|
|
|
|
func Clear() { |
|
|
|
_, h := termSize() |
|
|
|
_, h := WindowSize() |
|
|
|
buf := make([]byte, 2*h) |
|
|
|
for i := range buf { |
|
|
|
buf[i] = '\n' |
|
|
@ -15,9 +15,9 @@ func Clear() { |
|
|
|
mustWrite(buf) |
|
|
|
} |
|
|
|
|
|
|
|
// Line prints a line across the screen followed by a newline.
|
|
|
|
func PrintLine() { |
|
|
|
w, _ := termSize() |
|
|
|
// PrintHLine prints a line across the screen followed by a newline.
|
|
|
|
func PrintHLine() { |
|
|
|
w, _ := WindowSize() |
|
|
|
|
|
|
|
runes := make([]rune, w) |
|
|
|
for i := range runes { |
|
|
@ -38,7 +38,7 @@ func PrintBoxed(s string, args ...interface{}) { |
|
|
|
s = fmt.Sprintf(s, args...) |
|
|
|
} |
|
|
|
|
|
|
|
w, _ := termSize() |
|
|
|
w, _ := WindowSize() |
|
|
|
|
|
|
|
lines, textWidth := wrapText(s, w-4) |
|
|
|
|
|
|
@ -91,7 +91,7 @@ func PrintTextWithPrefix(prefix, s string, args ...interface{}) { |
|
|
|
} |
|
|
|
indent := len([]rune(prefix)) |
|
|
|
//sIndent := strings.Repeat(" ", indent)
|
|
|
|
w, _ := termSize() |
|
|
|
w, _ := WindowSize() |
|
|
|
lines, _ := wrapText(s, w-1-indent) |
|
|
|
for _, line := range lines { |
|
|
|
PrintString(prefix + line) |
|
|
|