Gim/cmd/gim/main.go
Hayden Hargreaves 77416bc0a4 feat: created theme module
This means we can finally create some themes! But the treesitter mapping
is not complete.
2026-04-07 21:44:34 -07:00

35 lines
733 B
Go

package main
import (
"os"
"git.gophernest.net/azpect/TextEditor/internal/program"
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() {
// <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)
}
}