All checks were successful
Run Test Suite / test (push) Successful in 15s
Also adjusted some of the IO tests for writing and force writing.
33 lines
655 B
Go
33 lines
655 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()).
|
|
Build()
|
|
} else {
|
|
prog = program.NewProgramBuilder().
|
|
FileProgram(args[0]).
|
|
WithOpt(tea.WithAltScreen()).
|
|
Build()
|
|
}
|
|
|
|
if _, err := prog.Run(); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|