mirror of
https://github.com/EnumeratedDev/Typer.git
synced 2025-07-01 07:48:20 +00:00
27 lines
547 B
Go
27 lines
547 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gdamore/tcell"
|
|
"strconv"
|
|
"strings"
|
|
)
|
|
|
|
func drawLineIndex(window *Window) {
|
|
screen := window.screen
|
|
buffer := window.textArea.CurrentBuffer
|
|
|
|
lineIndexStyle := tcell.StyleDefault.Foreground(tcell.ColorDimGray).Background(tcell.Color236)
|
|
|
|
_, sizeY := screen.Size()
|
|
|
|
y := 0
|
|
if window.ShowTopMenu {
|
|
y = 1
|
|
}
|
|
|
|
for lineIndex := 1; lineIndex <= strings.Count(buffer.Contents, "\n")+1 && lineIndex < sizeY; lineIndex++ {
|
|
drawText(screen, 0, y, 3, y, lineIndexStyle, strconv.Itoa(lineIndex)+". ")
|
|
y++
|
|
}
|
|
}
|