Use the underline style to display a cursor
This commit is contained in:
parent
b929ebe1a0
commit
4395e5d563
|
@ -108,8 +108,12 @@ func (input *Input) Draw (buffer stone.Buffer) {
|
||||||
character := input.charAtSafe(index + scroll)
|
character := input.charAtSafe(index + scroll)
|
||||||
|
|
||||||
if input.Selected() && index == input.cursor {
|
if input.Selected() && index == input.cursor {
|
||||||
buffer.SetRune(x, input.Y, '_')
|
buffer.SetStyle(x, input.Y, stone.StyleUnderline)
|
||||||
} else if input.Obscure && character > 0 {
|
} else {
|
||||||
|
buffer.SetStyle(x, input.Y, stone.StyleNormal)
|
||||||
|
}
|
||||||
|
|
||||||
|
if input.Obscure && character > 0 {
|
||||||
buffer.SetRune(x, input.Y, '*')
|
buffer.SetRune(x, input.Y, '*')
|
||||||
} else {
|
} else {
|
||||||
buffer.SetRune(x, input.Y, character)
|
buffer.SetRune(x, input.Y, character)
|
||||||
|
|
1
main.go
1
main.go
|
@ -274,6 +274,7 @@ func redrawStatus () {
|
||||||
width, height := application.Size()
|
width, height := application.Size()
|
||||||
for x := 0; x < width; x ++ {
|
for x := 0; x < width; x ++ {
|
||||||
application.SetRune(x, height - 1, 0)
|
application.SetRune(x, height - 1, 0)
|
||||||
|
application.SetStyle(x, height - 1, stone.StyleNormal)
|
||||||
}
|
}
|
||||||
|
|
||||||
application.SetDot(0, height - 1)
|
application.SetDot(0, height - 1)
|
||||||
|
|
Loading…
Reference in New Issue