Use the underline style to display a cursor

This commit is contained in:
Sasha Koshka 2022-11-29 03:24:40 -05:00
parent b929ebe1a0
commit 4395e5d563
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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)