update
This commit is contained in:
parent
c31be0e16d
commit
2234f9d7e4
@ -5,16 +5,39 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/charmbracelet/bubbles/table"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"context"
|
||||
"database/sql"
|
||||
"flag"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
)
|
||||
|
||||
|
||||
var baseStyle = lipglodd.NewStyle().
|
||||
BorderStyle(lipgloss.NormalBorder()).
|
||||
BorderForeground(lipgloss.Color("240"))
|
||||
|
||||
|
||||
|
||||
// Think of this `struct` as a JavaScript object or Python dictionary
|
||||
type model struct {
|
||||
// methods? Probably not
|
||||
todos []string // items on the to-do list
|
||||
cursor int // which to-do list item our cursor is pointing at
|
||||
cursor int // which to-do list item our cursor is pointing at
|
||||
// so it looks like Go doesn't have `_self` or `this`?
|
||||
selected map[int]struct{} // which to-do items are selected
|
||||
table table.Model
|
||||
}
|
||||
|
||||
func (m model) Init() tea.Cmd { return nil }
|
||||
|
||||
func initialModel() model {
|
||||
return model{
|
||||
// Our to-do list is a grocery list
|
||||
|
Loading…
x
Reference in New Issue
Block a user