Not totally complete WRT tests, but lots of progress. These interfaces make everything easy.
27 lines
565 B
Go
27 lines
565 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.gophernest.net/azpect/TextEditor/internal/action"
|
|
"git.gophernest.net/azpect/TextEditor/internal/editor"
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
func generateLines(n int) []string {
|
|
lines := make([]string, n)
|
|
for i := range n {
|
|
lines[i] = fmt.Sprintf("line %d", i+1)
|
|
}
|
|
return lines
|
|
}
|
|
|
|
func main() {
|
|
|
|
// lines := []string{"Hello world testing main.go", "line 2", "line 3", "line 4", "line 5"}
|
|
tea.NewProgram(
|
|
editor.NewModel(generateLines(32), action.Position{Line: 0, Col: 0}),
|
|
tea.WithAltScreen(),
|
|
).Run()
|
|
}
|