More accurate names for prev/next line movement functions

This commit is contained in:
Christian Rocha
2020-01-15 23:18:45 -05:00
parent 0c8e2ea5a0
commit da9de0c42b

12
tea.go
View File

@@ -169,13 +169,15 @@ func showCursor() {
fmt.Printf(esc + "?25h")
}
// Move the cursor up a given number of lines
func cursorDown(n int) {
// Move the cursor down a given number of lines and place it at the beginning
// of the line
func cursorNextLine(n int) {
fmt.Printf(esc+"%dE", n)
}
// Move the cursor up a given number of lines
func cursorUp(n int) {
// Move the cursor up a given number of lines and place it at the beginning of
// the line
func cursorPrevLine(n int) {
fmt.Printf(esc+"%dF", n)
}
@@ -188,7 +190,7 @@ func clearLine() {
func clearLines(n int) {
for i := 0; i < n; i++ {
clearLine()
cursorUp(1)
cursorPrevLine(1)
}
}