From a593d1348118c56559420121c8f623e662506ee0 Mon Sep 17 00:00:00 2001 From: Pierre Beitz Date: Fri, 12 Feb 2021 16:15:17 +0100 Subject: [PATCH] Fixes #334: Make sure the cursor goes back to the begining of the line when jumping lines. --- terminal/cursor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terminal/cursor.go b/terminal/cursor.go index c294ca4c..c50633dc 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.