mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
More accurate names for prev/next line movement functions
This commit is contained in:
12
tea.go
12
tea.go
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user