mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 13:36:12 +00:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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") && lineIndex < sizeY; lineIndex++ {
|
||||
drawText(screen, 0, y, 3, y, lineIndexStyle, strconv.Itoa(lineIndex)+". ")
|
||||
y++
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user