Skip to content

Commit

Permalink
Fixes AlecAivazis#334: Make sure the cursor goes back to the begining…
Browse files Browse the repository at this point in the history
… of the line when jumping lines.
  • Loading branch information
PierreBtz committed Apr 22, 2021
1 parent 4c67913 commit 98450d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions terminal/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ func (c *Cursor) Back(n int) {
// NextLine moves cursor to beginning of the line n lines down.
func (c *Cursor) NextLine(n int) {
c.Down(1)
c.HorizontalAbsolute(0)
}

// PreviousLine moves cursor to beginning of the line n lines up.
func (c *Cursor) PreviousLine(n int) {
c.Up(1)
c.HorizontalAbsolute(0)
}

// HorizontalAbsolute moves cursor horizontally to x.
Expand Down

0 comments on commit 98450d8

Please sign in to comment.