Gim/cmd/gim/main.go
Hayden Hargreaves 58082afdd2
All checks were successful
Run Test Suite / test (push) Successful in 15s
fix: added gutter fix and basic scroll
Scrolling is pretty useless, but nice touch
2026-04-05 00:16:19 -07:00

40 lines
850 B
Go

package main
import (
"os"
"git.gophernest.net/azpect/TextEditor/internal/program"
"git.gophernest.net/azpect/TextEditor/internal/theme"
tea "github.com/charmbracelet/bubbletea"
)
// main: Entry point for the Gim text editor. Creates a buffer and window,
// initializes the editor model, and runs the BubbleTea TUI program.
func main() {
if err := theme.RegisterAll(); err != nil {
panic(err)
}
// <exe> <filename>
args := os.Args[1:]
var prog *tea.Program
if len(args) < 1 {
prog = program.NewProgramBuilder().
EmptyProgram().
WithOpt(tea.WithAltScreen()).
WithOpt(tea.WithMouseCellMotion()).
Build()
} else {
prog = program.NewProgramBuilder().
FileProgram(args[0]).
WithOpt(tea.WithAltScreen()).
WithOpt(tea.WithMouseCellMotion()).
Build()
}
if _, err := prog.Run(); err != nil {
panic(err)
}
}