From 4395e5d5637f415cfc974a20e0f8f7d0e854c279 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 29 Nov 2022 03:24:40 -0500 Subject: [PATCH] Use the underline style to display a cursor --- input/input.go | 8 ++++++-- main.go | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/input/input.go b/input/input.go index d18aea5..7cdb7f5 100644 --- a/input/input.go +++ b/input/input.go @@ -108,8 +108,12 @@ func (input *Input) Draw (buffer stone.Buffer) { character := input.charAtSafe(index + scroll) if input.Selected() && index == input.cursor { - buffer.SetRune(x, input.Y, '_') - } else if input.Obscure && character > 0 { + buffer.SetStyle(x, input.Y, stone.StyleUnderline) + } else { + buffer.SetStyle(x, input.Y, stone.StyleNormal) + } + + if input.Obscure && character > 0 { buffer.SetRune(x, input.Y, '*') } else { buffer.SetRune(x, input.Y, character) diff --git a/main.go b/main.go index 52f1753..d08b96f 100644 --- a/main.go +++ b/main.go @@ -274,6 +274,7 @@ func redrawStatus () { width, height := application.Size() for x := 0; x < width; x ++ { application.SetRune(x, height - 1, 0) + application.SetStyle(x, height - 1, stone.StyleNormal) } application.SetDot(0, height - 1)