fix: use program.Start

This commit is contained in:
Maas Lalani 2022-10-17 20:23:59 -04:00
parent 5723977c68
commit 2e4ddce3f7
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000
8 changed files with 8 additions and 8 deletions

View file

@ -106,7 +106,7 @@ func (o Options) Run() error {
itemStyle: o.ItemStyle.ToLipgloss(),
selectedItemStyle: o.SelectedItemStyle.ToLipgloss(),
numSelected: currentSelected,
}, tea.WithOutput(os.Stderr)).StartReturningModel()
}, tea.WithOutput(os.Stderr)).Run()
if err != nil {
return fmt.Errorf("failed to start tea program: %w", err)

View file

@ -23,7 +23,7 @@ func (o Options) Run() error {
selectedStyle: o.SelectedStyle.ToLipgloss(),
unselectedStyle: o.UnselectedStyle.ToLipgloss(),
promptStyle: o.PromptStyle.ToLipgloss(),
}, tea.WithOutput(os.Stderr)).StartReturningModel()
}, tea.WithOutput(os.Stderr)).Run()
if err != nil {
return fmt.Errorf("unable to run confirm: %w", err)

View file

@ -43,7 +43,7 @@ func (o Options) Run() error {
fileSizeStyle: o.FileSizeStyle.ToLipgloss().Inline(true),
}
tm, err := tea.NewProgram(&m, tea.WithOutput(os.Stderr)).StartReturningModel()
tm, err := tea.NewProgram(&m, tea.WithOutput(os.Stderr)).Run()
if err != nil {
return fmt.Errorf("unable to pick selection: %w", err)
}

View file

@ -82,7 +82,7 @@ func (o Options) Run() error {
fuzzy: o.Fuzzy,
}, options...)
tm, err := p.StartReturningModel()
tm, err := p.Run()
if err != nil {
return fmt.Errorf("unable to run filter: %w", err)
}

View file

@ -40,7 +40,7 @@ func (o Options) Run() error {
textinput: i,
aborted: false,
}, tea.WithOutput(os.Stderr))
tm, err := p.StartReturningModel()
tm, err := p.Run()
if err != nil {
return fmt.Errorf("failed to run input: %w", err)
}

View file

@ -25,7 +25,7 @@ func (o Options) Run() error {
align: o.Align,
}
p := tea.NewProgram(m, tea.WithOutput(os.Stderr))
mm, err := p.StartReturningModel()
mm, err := p.Run()
m = mm.(model)
if err != nil {

View file

@ -91,7 +91,7 @@ func (o Options) Run() error {
table.WithStyles(styles),
)
tm, err := tea.NewProgram(model{table: table}, tea.WithOutput(os.Stderr)).StartReturningModel()
tm, err := tea.NewProgram(model{table: table}, tea.WithOutput(os.Stderr)).Run()
if err != nil {
return fmt.Errorf("failed to start tea program: %w", err)

View file

@ -52,7 +52,7 @@ func (o Options) Run() error {
header: o.Header,
headerStyle: o.HeaderStyle.ToLipgloss(),
}, tea.WithOutput(os.Stderr))
tm, err := p.StartReturningModel()
tm, err := p.Run()
if err != nil {
return fmt.Errorf("failed to run write: %w", err)
}