mirror of
https://github.com/charmbracelet/gum
synced 2024-05-18 22:26:42 +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(),
|
itemStyle: o.ItemStyle.ToLipgloss(),
|
||||||
selectedItemStyle: o.SelectedItemStyle.ToLipgloss(),
|
selectedItemStyle: o.SelectedItemStyle.ToLipgloss(),
|
||||||
numSelected: currentSelected,
|
numSelected: currentSelected,
|
||||||
}, tea.WithOutput(os.Stderr)).StartReturningModel()
|
}, tea.WithOutput(os.Stderr)).Run()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to start tea program: %w", err)
|
return fmt.Errorf("failed to start tea program: %w", err)
|
||||||
|
|
|
@ -23,7 +23,7 @@ func (o Options) Run() error {
|
||||||
selectedStyle: o.SelectedStyle.ToLipgloss(),
|
selectedStyle: o.SelectedStyle.ToLipgloss(),
|
||||||
unselectedStyle: o.UnselectedStyle.ToLipgloss(),
|
unselectedStyle: o.UnselectedStyle.ToLipgloss(),
|
||||||
promptStyle: o.PromptStyle.ToLipgloss(),
|
promptStyle: o.PromptStyle.ToLipgloss(),
|
||||||
}, tea.WithOutput(os.Stderr)).StartReturningModel()
|
}, tea.WithOutput(os.Stderr)).Run()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to run confirm: %w", err)
|
return fmt.Errorf("unable to run confirm: %w", err)
|
||||||
|
|
|
@ -43,7 +43,7 @@ func (o Options) Run() error {
|
||||||
fileSizeStyle: o.FileSizeStyle.ToLipgloss().Inline(true),
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to pick selection: %w", err)
|
return fmt.Errorf("unable to pick selection: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ func (o Options) Run() error {
|
||||||
fuzzy: o.Fuzzy,
|
fuzzy: o.Fuzzy,
|
||||||
}, options...)
|
}, options...)
|
||||||
|
|
||||||
tm, err := p.StartReturningModel()
|
tm, err := p.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to run filter: %w", err)
|
return fmt.Errorf("unable to run filter: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ func (o Options) Run() error {
|
||||||
textinput: i,
|
textinput: i,
|
||||||
aborted: false,
|
aborted: false,
|
||||||
}, tea.WithOutput(os.Stderr))
|
}, tea.WithOutput(os.Stderr))
|
||||||
tm, err := p.StartReturningModel()
|
tm, err := p.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to run input: %w", err)
|
return fmt.Errorf("failed to run input: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ func (o Options) Run() error {
|
||||||
align: o.Align,
|
align: o.Align,
|
||||||
}
|
}
|
||||||
p := tea.NewProgram(m, tea.WithOutput(os.Stderr))
|
p := tea.NewProgram(m, tea.WithOutput(os.Stderr))
|
||||||
mm, err := p.StartReturningModel()
|
mm, err := p.Run()
|
||||||
m = mm.(model)
|
m = mm.(model)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -91,7 +91,7 @@ func (o Options) Run() error {
|
||||||
table.WithStyles(styles),
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to start tea program: %w", err)
|
return fmt.Errorf("failed to start tea program: %w", err)
|
||||||
|
|
|
@ -52,7 +52,7 @@ func (o Options) Run() error {
|
||||||
header: o.Header,
|
header: o.Header,
|
||||||
headerStyle: o.HeaderStyle.ToLipgloss(),
|
headerStyle: o.HeaderStyle.ToLipgloss(),
|
||||||
}, tea.WithOutput(os.Stderr))
|
}, tea.WithOutput(os.Stderr))
|
||||||
tm, err := p.StartReturningModel()
|
tm, err := p.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to run write: %w", err)
|
return fmt.Errorf("failed to run write: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue