mirror of
https://github.com/charmbracelet/gum.git
synced 2024-08-17 02:00:46 +03:00
fix: use WithAltScreen instead of deprecated EnterAltScreen
This commit is contained in:
parent
b8669c420b
commit
35e044d140
@ -35,6 +35,11 @@ func (o Options) Run() error {
|
||||
choices = files.List()
|
||||
}
|
||||
|
||||
options := []tea.ProgramOption{tea.WithOutput(os.Stderr)}
|
||||
if o.Height == 0 {
|
||||
options = append(options, tea.WithAltScreen())
|
||||
}
|
||||
|
||||
p := tea.NewProgram(model{
|
||||
choices: choices,
|
||||
indicator: o.Indicator,
|
||||
@ -45,11 +50,7 @@ func (o Options) Run() error {
|
||||
matchStyle: o.MatchStyle.ToLipgloss(),
|
||||
textStyle: o.TextStyle.ToLipgloss(),
|
||||
height: o.Height,
|
||||
}, tea.WithOutput(os.Stderr))
|
||||
|
||||
if o.Height == 0 {
|
||||
p.EnterAltScreen()
|
||||
}
|
||||
}, options...)
|
||||
|
||||
tm, err := p.StartReturningModel()
|
||||
m := tm.(model)
|
||||
|
Loading…
Reference in New Issue
Block a user