package main

import (
	"fmt"

	"git.gophernest.net/azpect/TextEditor/internal/action"
	"git.gophernest.net/azpect/TextEditor/internal/editor"
	tea "github.com/charmbracelet/bubbletea"
)

func main() {
	m, _ := tea.NewProgram(
		editor.NewModel([]string{""}, action.Position{Line: 0, Col: 0}),
		tea.WithAltScreen(),
	).Run()

	final, ok := m.(*editor.Model)
	if ok {
		fmt.Printf("PRINTING WINDOWS: %+v\n", final.Windows())
		fmt.Printf("PRINTING ACTIVE WINDOW: %+v\n", final.ActiveWindow())
		for _, win := range final.Windows() {
			fmt.Printf("\t%+v\n", *win.Buffer)
		}
	} else {
		fmt.Printf("PRINTING ALL: %+v\n", m)
	}

}
