summaryrefslogtreecommitdiff
path: root/vendor/github.com/buger/goterm/terminal.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-01-08 14:52:57 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-01-11 13:38:11 +0100
commitbd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87 (patch)
tree5f06e4e289f16d9164d692590a3fe6541b5384cf /vendor/github.com/buger/goterm/terminal.go
parent545f24421247c9f6251a634764db3f8f8070a812 (diff)
downloadpodman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.tar.gz
podman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.tar.bz2
podman-bd40dcfc2bc7c9014ea1f33482fb63aacbcdfe87.zip
vendor: update everything
* If possible, update each dependency to the latest available version. * Use releases over commit IDs and avoid vendoring branches. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/buger/goterm/terminal.go')
-rw-r--r--vendor/github.com/buger/goterm/terminal.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/github.com/buger/goterm/terminal.go b/vendor/github.com/buger/goterm/terminal.go
index 6b45c78bc..7c4dfa70f 100644
--- a/vendor/github.com/buger/goterm/terminal.go
+++ b/vendor/github.com/buger/goterm/terminal.go
@@ -27,7 +27,7 @@ const RESET = "\033[0m"
// Reset to default color
const RESET_COLOR = "\033[32m"
-// Return curor to start of line and clean it
+// Return cursor to start of line and clean it
const RESET_LINE = "\r\033[K"
// List of possible colors
@@ -68,10 +68,10 @@ type winsize struct {
}
// Global screen buffer
-// Its not recommented write to buffer dirrectly, use package Print,Printf,Println fucntions instead.
+// Its not recommended write to buffer dirrectly, use package Print,Printf,Println fucntions instead.
var Screen *bytes.Buffer = new(bytes.Buffer)
-// Get relative or absolute coorditantes
+// Get relative or absolute coordinates
// To get relative, set PCT flag to number:
//
// // Get 10% of total width to `x` and 20 to y
@@ -113,7 +113,7 @@ func Clear() {
// Move cursor to given position
func MoveCursor(x int, y int) {
- fmt.Fprintf(Screen, "\033[%d;%dH", x, y)
+ fmt.Fprintf(Screen, "\033[%d;%dH", y, x)
}
// Move cursor up relative the current position
@@ -148,7 +148,7 @@ func MoveTo(str string, x int, y int) (out string) {
// Return carrier to start of line
func ResetLine(str string) (out string) {
return applyTransform(str, func(idx int, line string) string {
- return fmt.Sprintf(RESET_LINE, line)
+ return fmt.Sprintf("%s%s", RESET_LINE, line)
})
}
@@ -215,12 +215,12 @@ func CurrentHeight() int {
// Flush buffer and ensure that it will not overflow screen
func Flush() {
- for idx, str := range strings.Split(Screen.String(), "\n") {
+ for idx, str := range strings.SplitAfter(Screen.String(), "\n") {
if idx > Height() {
return
}
- Output.WriteString(str + "\n")
+ Output.WriteString(str)
}
Output.Flush()