From 69b2cbec85a83f08e100da9489df0bb15d6528e6 Mon Sep 17 00:00:00 2001 From: Pierre Beitz Date: Thu, 22 Apr 2021 16:30:16 +0200 Subject: [PATCH] Fixes #334: Make sure the cursor goes back to the begining of the line when jumping lines. (#335) --- terminal/cursor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terminal/cursor.go b/terminal/cursor.go index 1bc427c9..1ac74fd6 100644 --- a/terminal/cursor.go +++ b/terminal/cursor.go @@ -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.