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 Feb 12, 2021
1 parent a21fb70 commit a593d13
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 a593d13

Please sign in to comment.