mirror of
https://github.com/charmbracelet/gum
synced 2024-05-08 01:06:37 +02:00
fix: use program.Start
This commit is contained in:
parent
5723977c68
commit
2e4ddce3f7
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue